Skip to content

Conversation

@pablogsal
Copy link
Member

@pablogsal pablogsal commented Mar 6, 2020

https://bugs.python.org/issue38894

I have opted to reproduce the behaviour of Python < 3.7 instead of ignoring EACCESS to avoid calling needlessly entry.is_dir() when self.dironly is False.

Copy link
Member

@pitrou pitrou left a 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():
Copy link
Member

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?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done in 38894

@pablogsal pablogsal merged commit eb7560a into python:master Mar 7, 2020
@miss-islington
Copy link
Contributor

Thanks @pablogsal for the PR 🌮🎉.. I'm working now to backport this PR to: 3.7, 3.8.
🐍🍒⛏🤖

@pablogsal pablogsal deleted the bpo-38894 branch March 7, 2020 17:53
miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Mar 7, 2020
…fficient permissions (pythonGH-18815)

Co-authored-by: Matt Wozniski <[email protected]>
(cherry picked from commit eb7560a)

Co-authored-by: Pablo Galindo <[email protected]>
@bedevere-bot
Copy link

GH-18830 is a backport of this pull request to the 3.8 branch.

@bedevere-bot
Copy link

GH-18831 is a backport of this pull request to the 3.7 branch.

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Mar 7, 2020
…fficient permissions (pythonGH-18815)

Co-authored-by: Matt Wozniski <[email protected]>
(cherry picked from commit eb7560a)

Co-authored-by: Pablo Galindo <[email protected]>
miss-islington added a commit that referenced this pull request Mar 7, 2020
…fficient permissions (GH-18815)

Co-authored-by: Matt Wozniski <[email protected]>
(cherry picked from commit eb7560a)

Co-authored-by: Pablo Galindo <[email protected]>
miss-islington added a commit that referenced this pull request Mar 7, 2020
…fficient permissions (GH-18815)

Co-authored-by: Matt Wozniski <[email protected]>
(cherry picked from commit eb7560a)

Co-authored-by: Pablo Galindo <[email protected]>
blueyed added a commit to blueyed/cpython that referenced this pull request Oct 29, 2020
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?
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.

5 participants