-
-
Notifications
You must be signed in to change notification settings - Fork 33.7k
bpo-38894: Fix pathlib.Path.glob in the presence of symlinks and insufficient permissions #18815
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
Conversation
28c8710 to
ad03688
Compare
…fficient permissions Co-authored-by: Matt Wozniski <[email protected]>
pitrou
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for tackling this hairy issue!
| yield p | ||
| if self.dironly: | ||
| try: | ||
| if not entry.is_dir(): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps add a comment mentioning that it can raise a PermissionError which is not part of the ignored errnos?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done in 38894
…nd insufficient permissions
|
Thanks @pablogsal for the PR 🌮🎉.. I'm working now to backport this PR to: 3.7, 3.8. |
…fficient permissions (pythonGH-18815) Co-authored-by: Matt Wozniski <[email protected]> (cherry picked from commit eb7560a) Co-authored-by: Pablo Galindo <[email protected]>
|
GH-18830 is a backport of this pull request to the 3.8 branch. |
|
GH-18831 is a backport of this pull request to the 3.7 branch. |
…fficient permissions (pythonGH-18815) Co-authored-by: Matt Wozniski <[email protected]> (cherry picked from commit eb7560a) Co-authored-by: Pablo Galindo <[email protected]>
…fficient permissions (GH-18815) Co-authored-by: Matt Wozniski <[email protected]> (cherry picked from commit eb7560a) Co-authored-by: Pablo Galindo <[email protected]>
…fficient permissions (GH-18815) Co-authored-by: Matt Wozniski <[email protected]> (cherry picked from commit eb7560a) Co-authored-by: Pablo Galindo <[email protected]>
Refs: - bpo-24120 (python@6c2d33a258bb) uses to broad try/catch for PermissionError, which led to bpo-38894 in the first place - bpo-38894 (python#18815) fixed handling only for `_WildcardSelector` TODO: tests for others?
https://bugs.python.org/issue38894
I have opted to reproduce the behaviour of Python < 3.7 instead of ignoring
EACCESSto avoid calling needlesslyentry.is_dir()whenself.dironlyisFalse.