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

Use errno.EISDIR and errno.EACCESS instead of hardcoding values #1196

Merged
merged 4 commits into from
Feb 19, 2024

Conversation

dktrkranz
Copy link
Contributor

No description provided.

@arsenetar
Copy link
Owner

Windows tests show failures with this change. I think both codes need to be kept. The Linux one can be replaced with EISDIR.

@dktrkranz
Copy link
Contributor Author

Indeed Windows seems to rely on EACCES, added that as well.

@dktrkranz dktrkranz changed the title Use errno.EISDIR instead of hardcoding values Use errno.EISDIR & EACCESS instead of hardcoding values Feb 12, 2024
@dktrkranz dktrkranz changed the title Use errno.EISDIR & EACCESS instead of hardcoding values Use errno.EISDIR and errno.EACCESS instead of hardcoding values Feb 12, 2024
# the code we get on OS X and Linux, 13 is what we get on Windows.
if e.errno in {21, 13}:
# If our OSError is because dest is already a directory, we want to handle that.
if e.errno in (EISDIR, EACCES):
Copy link
Owner

Choose a reason for hiding this comment

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

I do think maybe leaving the note about how different errors here are due to the different OSes would be helpful in the future. Same in the other file as well.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Comments refactored as per suggestion

@arsenetar arsenetar merged commit 9f22835 into arsenetar:master Feb 19, 2024
6 of 7 checks passed
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