Skip to content

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

Merged
merged 3 commits into from
Apr 17, 2019

Conversation

LihuaZhao
Copy link
Contributor

@LihuaZhao LihuaZhao commented Apr 1, 2019

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

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.
@bedevere-bot bedevere-bot added tests Tests in the Lib/test dir awaiting review labels Apr 1, 2019
@LihuaZhao LihuaZhao changed the title Fix file not exist bpo-31904: Fix file not exist error string Apr 1, 2019
@LihuaZhao
Copy link
Contributor Author

The buildbot failure doesn't matter with test_tabnanny, which already pass.

Thanks.
Lihua

@LihuaZhao LihuaZhao closed this Apr 4, 2019
@LihuaZhao LihuaZhao reopened this Apr 4, 2019
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"
Copy link
Member

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 "" ;-))

@@ -5,6 +5,7 @@
"""
from unittest import TestCase, mock
from unittest import mock
import sys
Copy link
Member

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
Copy link
Member

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.

@bedevere-bot
Copy link

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. I will then notify any core developers who have left a review that you're ready for them to take another look at this pull request.

@LihuaZhao
Copy link
Contributor Author

I have made the requested changes; please review again.

@bedevere-bot
Copy link

Thanks for making the requested changes!

@vstinner: please review the changes made to this pull request.

@vstinner
Copy link
Member

Thanks @LihuaZhao: the change now makes the test better on all platforms, rather than introducing code specific to VxWorks! :-)

@pxinwr pxinwr deleted the fix-file-not-exist branch July 12, 2021 09:42
@kuhlenough kuhlenough mannequin mentioned this pull request Jan 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
tests Tests in the Lib/test dir
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants