-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
Fix Windows folder writable detection #8025
Conversation
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.
You will need to add a test for this change and also please add a news file entry specifying this change.
@@ -161,7 +161,7 @@ def _test_writable_dir_win(path): | |||
except OSError as e: | |||
if e.errno == errno.EEXIST: | |||
continue | |||
if e.errno == errno.EPERM: | |||
if e.errno == errno.EPERM or e.errno == errno.EACCES: | |||
# This could be because there's a directory with the same name. | |||
# But it's highly unlikely there's a directory called that, | |||
# so we'll assume it's because the parent dir is not writable. |
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.
You can update the comment as well indicating the other reason, this would return False
.
I’m OK with the fix ( Also, you will need to add a news fragment describing the change. Please take a look at the development guide to learn how. |
Maybe a subprocess is need to run The original code was copied from Flit, in which |
pip already run subprocesses in tests. Would it be possible to extend If not, I think it’d be enough to simply add a comment to the copied functions pointing to Flit’s corresponding code, and describe briefly how they are ported to Python 2. |
Thanks for the contribution, @catPill 🙂 |
Fixes #8013