Skip to content
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

Refactor/unify/extract shutil.rmtree callbacks (and avoid repetition) #4682

Open
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

abravalheri
Copy link
Contributor

Summary of changes

I noticed that there are at least 2 implementations of shutil.rmtree callbacks in setuptools: one for easy_install and one for bdist_wheel. There is also other places in setuptools that we don't have those callbacks (so potentially still subject to errors on Windows?).

So this PR tries to unify these 2 separated implementations.
I have chosen to extract the implementation from easy_install.
One notable difference though is that bdist_wheel's implementation always try to apply the chmod callback when it fails, while the easy_install implementation is more conservative and only applies the callback on Windows (similar to the suggestion in https://github.com/python/cpython/issues/87823#issuecomment-1093908280)... So that might generate a bit of change in behaviour, but with a bit of luck should be compatible.

The name _shutil was used for the lack of a better name/imagination, and can be changed.

Closes

Pull Request Checklist

@abravalheri abravalheri marked this pull request as ready for review October 16, 2024 12:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants