Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork32k
gh-102828: add onexc arg to shutil.rmtree. Deprecate onerror.#102829
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
giampaolo commentedMar 19, 2023 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
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) |
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. |
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 commentedMar 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.
When you're done making the requested changes, leave the comment: I have made the requested changes; please review again. |
bedevere-bot commentedMar 19, 2023
Thanks for making the requested changes! @giampaolo: please review the changes made to this pull request. |
bedevere-bot commentedMar 19, 2023
|
bedevere-bot commentedMar 19, 2023
|
@iritkatriel looks like this broke some build bots.
|
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. |
Ignore my experiment with the 1st buildbot report. |
barneygale commentedApr 3, 2023 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
Hey, why does If it accepted only one argument, then:
The only thing lost would be the |
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. |
Righto, thanks. I've logged#103218. |
Uh oh!
There was an error while loading.Please reload this page.
onexc expects an exception instead of exc_info. This is part of the larger effort to move on from exc_info.
Fixes#102828.