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
gh-71916: Give a better error msg when a file path is too long on Windows #20844
base: main
Are you sure you want to change the base?
Conversation
It would be nice to add a test that checks the error message when an empty string is passed to |
@@ -418,7 +421,12 @@ _io_FileIO___init___impl(fileio *self, PyObject *nameobj, const char *mode, | |||
|
|||
fd_is_own = 1; | |||
if (self->fd < 0) { | |||
#ifdef MS_WINDOWS | |||
PyErr_SetExcFromWindowsErrWithFilenameObject( | |||
PyExc_OSError, _doserrno, nameobj); |
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.
What does the error look like in the path too long case with this change? Would it be more helpful if we checked the error code and used our own message?
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.
This has a merge conflict now, as well as an unanswered review.
A Python core developer has requested some changes be made to your pull request before we can consider merging it. If you could please address their requests along with any other requests in other reviews from core developers that would be appreciated. Once you have made the requested changes, please leave a comment on this pull request containing the phrase |
https://bugs.python.org/issue27729