-
-
Notifications
You must be signed in to change notification settings - Fork 37.4k
Undeprecate the onerror argument in shutil.rmtree() #112645
Copy link
Copy link
Closed
Labels
3.12only security fixesonly security fixes3.13only security fixesonly security fixesstdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directorytype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
Description
Activity
Metadata
Metadata
Assignees
Labels
3.12only security fixesonly security fixes3.13only security fixesonly security fixesstdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directorytype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
Bug report
A new
onexcparameter was added inshutil.rmtree()in 3.12 (see #102828). At the same time passing theonerrorargument was deprecated. It creates inconvenience for code that should run on several Python versions. It forces users to modify their working code to avoid deprecation warnings.I think that there was nothing wrong in
onerror. The only advantage ofonexcoveronerrorwas that it may require to write less code in some cases, but the deprecation causes an opposite effect -- it requires to write more code.So I think that the deprecation should be reverted.
@iritkatriel
Linked PRs