-
-
Notifications
You must be signed in to change notification settings - Fork 31.9k
Python 3.10/3.8: shutil.rmtree(None, ignore_errors=True) behaves differently between Windows and *nix platforms #94692
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
Comments
I disagree with this. The intent isn't to hide all errors, but rather filesystem errors. The only change here might be to not ignore the TypeError on macOS. |
+1 to Eric. It's conceivable that these Lines 721 to 727 in 4bed0db
except Exception was intentional.
|
Yeah, it's unclear if maybe macOS raises some other non- |
Functions in the |
Thanks for the clarification @ericvsmith @eryksun . I think documenting specifically that ignore_errors does not trap all exceptions as I (and others on my team) had naively assumed a different behavior of ignore_errors. Perhaps |
Previously a symlink attack resistant version of shutil.rmtree() could ignore or pass to the error handler arbitrary exception when invalid arguments were provided.
I am wondering whether this change should be considered a bug fix (and backported) or a new feature (and only applied to main). |
Since this isn't a new regression, it is properly worked around by people who noticed, and by those who didn't, it's a behavioral change. Let's treat as feature. |
Previously a symlink attack resistant version of shutil.rmtree() could ignore or pass to the error handler arbitrary exception when invalid arguments were provided.
Then perhaps add |
Co-authored-by: Alex Waygood <[email protected]>
Previously a symlink attack resistant version of shutil.rmtree() could ignore or pass to the error handler arbitrary exception when invalid arguments were provided.
Co-authored-by: Alex Waygood <[email protected]>
Previously a symlink attack resistant version of shutil.rmtree() could ignore or pass to the error handler arbitrary exception when invalid arguments were provided.
Co-authored-by: Alex Waygood <[email protected]>
Bug report
Expected behavior: Passing None to shutil.rmtree's path argument should not yield an exception when ignore_errors=True.
Behavior on MacOS Python 3.10 (MacPorts) - Correct behavior:
The above occurs on RedHat Linux 8 Python 3.8 and Python 3.10 as well.
Behavior on Windows (Incorrect/differs from MacOS/Linux):
Environment
Linked PRs
The text was updated successfully, but these errors were encountered: