Uh oh!
There was an error while loading. Please reload this page.
gh-102828: add onexc arg to shutil.rmtree. Deprecate onerror. - #102829
Conversation
I like the idea in principle, but existing code using I'm not sure what's the current policy re. deprecations, but I suppose there can be a transitional time (2 releases? 3?) during which using try:
...
exceptOSErroraserr:
ifonerrorisnotNone:
warnings.warn("'onerror' argument is deprecated and will be removed in XXX. Use 'onexc' argument instead.", DeprecationWarning)
onerror(..., ..., sys.exc_info())
ifonexcisnotNone:
onerror(..., ..., err) |
iritkatriel
commented
Mar 19, 2023
It will still work, because onerror gets wrapped by onexc in Lib/shutil.py:708-714. Note that I didn't remove any tests, so all previous functionality is still there. |
giampaolo
commented
Mar 19, 2023
Oh you're right sorry. I misread your patch. |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
bedevere-bot
commented
Mar 19, 2023
When you're done making the requested changes, leave the comment: |
Uh oh!
There was an error while loading. Please reload this page.
iritkatriel
commented
Mar 19, 2023
When you're done making the requested changes, leave the comment: I have made the requested changes; please review again. |
bedevere-bot
commented
Mar 19, 2023
Thanks for making the requested changes! @giampaolo: please review the changes made to this pull request. |
bedevere-bot
commented
Mar 19, 2023
|
bedevere-bot
commented
Mar 19, 2023
|
giampaolo
commented
Mar 19, 2023
@iritkatriel looks like this broke some build bots. |
iritkatriel
commented
Mar 19, 2023
I see what I did - I copied part of this test from another test, but I didn't copy the skip instructions that make it not run where it doesn't work. Will fix. |
terryjreedy
commented
Mar 19, 2023
Ignore my experiment with the 1st buildbot report. |
Hey, why does If it accepted only one argument, then:
The only thing lost would be the |
iritkatriel
commented
Apr 3, 2023
Because that's what onerror did. This PR was just about replacing exc_info by exc. Feel free to suggest additional changes in a separate issue. |
barneygale
commented
Apr 3, 2023
Righto, thanks. I've logged #103218. |
onexc expects an exception instead of exc_info. This is part of the larger effort to move on from exc_info.
Fixes#102828.