Skip to content

add option for error callback of to shutil.rmtree to accept exception rather than exc_info #102828

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

Closed
iritkatriel opened this issue Mar 19, 2023 · 3 comments · Fixed by #102829
Closed
Labels
type-feature A feature request or enhancement

Comments

@iritkatriel
Copy link
Member

iritkatriel commented Mar 19, 2023

shutil.rmtree accepts as onerror a callback to should expect an exc_info tuple. To move off this, I will add a new kwarg "onexc" which should expect just an exception object. onerror will continue to work for now, but be deprecated.

Linked PRs

@iritkatriel iritkatriel added the type-feature A feature request or enhancement label Mar 19, 2023
iritkatriel added a commit to iritkatriel/cpython that referenced this issue Mar 19, 2023
iritkatriel added a commit to iritkatriel/cpython that referenced this issue Mar 19, 2023
iritkatriel added a commit to iritkatriel/cpython that referenced this issue Mar 20, 2023
Fidget-Spinner pushed a commit to Fidget-Spinner/cpython that referenced this issue Mar 27, 2023
warsaw pushed a commit to warsaw/cpython that referenced this issue Apr 11, 2023
@serhiy-storchaka
Copy link
Member

serhiy-storchaka commented Dec 3, 2023

I think it is too early to deprecate onerror. It only creates inconvenience for code that should support multiple Python versions. Opened #112645 for this.

@kfsone
Copy link

kfsone commented Jul 1, 2024

What is the urgency in removing the 'onerror' parameter? A concern about shutil.rmtree performance of accepting both arguments? Or is it just part of the core-python lemming-suicide pact to drive users away by making python as consistently self-incompatible as possible?

@iritkatriel
Copy link
Member Author

What is the urgency in removing the 'onerror' parameter?

Nobody indicated any urgency. You made that up just so you can entertain us with your witty insult.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type-feature A feature request or enhancement
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants