-
-
Notifications
You must be signed in to change notification settings - Fork 32.1k
bpo-43219: shutil.copyfile, raise a less confusing exception instead of IsADirectoryError #27049
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
bpo-43219: shutil.copyfile, raise a less confusing exception instead of IsADirectoryError #27049
Conversation
Note that before merging, this should be run with builds on other OSes like Aix, FreeBSD, etc. |
For reviewing: note that the code block wrapped in try/except is unchanged except for indentation. |
…of IsADirectoryError (pythonGH-27049) Fixes the misleading IsADirectoryError to be FileNotFoundError. (cherry picked from commit 248173c) Co-authored-by: andrei kulakov <andrei.avk@gmail.com>
GH-27081 is a backport of this pull request to the 3.10 branch. |
…of IsADirectoryError (pythonGH-27049) Fixes the misleading IsADirectoryError to be FileNotFoundError. (cherry picked from commit 248173c) Co-authored-by: andrei kulakov <andrei.avk@gmail.com>
GH-27082 is a backport of this pull request to the 3.9 branch. |
@gpshead Thanks for the review :) |
This now raises a wrong |
FileNotFoundError is a common exception for "file or directory does not exist". If you feel it's wrongly raised in some scenario, please open a new issue on bugs.python.org and add an example and expected / observed output. |
But the path exists. It only is a directory. This PR changed the correct |
@Flamefire I think you're right, I can reproduce it. I will reopen the issue. |
I opened https://bugs.python.org/issue45234 but mentioned the new failure in 43219 |
https://bugs.python.org/issue43219