You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Undeprecate the onerror argument in shutil.rmtree() #112645
A new onexc parameter was added in shutil.rmtree() in 3.12 (see #102828). At the same time passing the onerror 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 of onexc over onerror 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.
Activity
iritkatriel commentedon Dec 3, 2023
We can remove the deprecation warning but leave it deprecated in the docs.
pythongh-112645: remove deprecation warning for use of onerror in shu…
gh-112645: remove deprecation warning for use of onerror in shutil.rm…
serhiy-storchaka commentedon Dec 3, 2023
Thank you @iritkatriel. Please backport this change to 3.12.
pythongh-112645: remove deprecation warning for use of onerror in shu…
[3.12] gh-112645: remove deprecation warning for use of onerror in sh…
pythongh-112645: remove deprecation warning for use of onerror in shu…
hugovk commentedon May 10, 2024
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
hugovk commentedon May 11, 2024
Please see PR #118947.
pythongh-112645: remove deprecation warning for use of onerror in shu…