-
-
Notifications
You must be signed in to change notification settings - Fork 30.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Undeprecate the onerror argument in shutil.rmtree() #112645
Comments
We can remove the deprecation warning but leave it deprecated in the docs. |
Thank you @iritkatriel. Please backport this change to 3.12. |
…til.rmtree (python#112659) (cherry picked from commit 97857ac)
This is still listed as pending removal in 3.14: https://docs.python.org/3.13/whatsnew/3.13.html#pending-removal-in-python-3-14 Should we instead update the docs so it's listed as pending removal in an unspecified, future version? https://docs.python.org/3.13/whatsnew/3.13.html#pending-removal-in-future-versions |
Please see PR #118947. |
Bug report
A new
onexc
parameter was added inshutil.rmtree()
in 3.12 (see #102828). At the same time passing theonerror
argument 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 ofonexc
overonerror
was 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
The text was updated successfully, but these errors were encountered: