-
-
Notifications
You must be signed in to change notification settings - Fork 32k
bpo-31904: Fix file not exist error string #12646
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
Conversation
The strerror return "no such file or directory" when error code is ENOENT on VxWorks, this is different from Linux, change test_tabnanny.py toVxWorks excpected string.
The buildbot failure doesn't matter with test_tabnanny, which already pass. Thanks. |
Lib/test/test_tabnanny.py
Outdated
f"no such file or directory: {path!r}\n" | ||
else: | ||
err = f"{path!r}: I/O Error: [Errno {errno.ENOENT}] " \ | ||
f"No such file or directory: {path!r}\n" |
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.
Can you please to use os.strerror(errno.ENOENT) to avoid the if? Something like:
err = (f"{path!r}: I/O Error: [Errno {errno.ENOENT}] "
f"{os.strerror(errno.ENOENT)}: {path!r}\n")
Note: I would prefer to use parenthesis to avoid trailing "" ;-))
Lib/test/test_tabnanny.py
Outdated
@@ -5,6 +5,7 @@ | |||
""" | |||
from unittest import TestCase, mock | |||
from unittest import mock | |||
import sys |
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.
nitpick: sort imports, sys goes after errno.
@@ -0,0 +1 @@ | |||
Handle VxWorks error string of ENOENT |
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.
Please move this NEWS entry to the Tests category. I suggest:
Fix test_tabnanny on VxWorks: adjust ENOENT error message.
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 |
I have made the requested changes; please review again. |
Thanks for making the requested changes! @vstinner: please review the changes made to this pull request. |
Thanks @LihuaZhao: the change now makes the test better on all platforms, rather than introducing code specific to VxWorks! :-) |
The strerror return "no such file or directory" when error code is ENOENT on VxWorks, this is different from Linux, change test_tabnanny.py toVxWorks excpected string.
https://bugs.python.org/issue31904