[proxy] web.archive.org← back | site home | direct (HTTPS) ↗ | proxy home | ◑ dark◐ light
/ cpython Public
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-31904: Fix file not exist error string #12646

Merged
merged 3 commits into from Apr 17, 2019

Conversation

Copy link
Contributor

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

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

LihuaZhao commented Apr 1, 2019

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

Thanks.
Lihua

LihuaZhao closed this Apr 4, 2019
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

vstinner Apr 16, 2019

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

vstinner Apr 16, 2019

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

vstinner Apr 16, 2019

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.

Copy link

bedevere-bot commented Apr 16, 2019

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.

Copy link
Contributor Author

LihuaZhao commented Apr 17, 2019

I have made the requested changes; please review again.

Copy link

bedevere-bot commented Apr 17, 2019

Thanks for making the requested changes!

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

Copy link
Member

vstinner commented Apr 17, 2019

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

pxinwr deleted the fix-file-not-exist branch Jul 12, 2021
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.

None yet

4 participants