-
-
Notifications
You must be signed in to change notification settings - Fork 32.1k
bpo-44031: fix test_tabnanny failure in non-ascii CWD #31014
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
Lib/test/test_tabnanny.py
Outdated
@@ -293,8 +293,8 @@ def validate_cmd(self, *args, stdout="", stderr="", partial=False): | |||
_, out, err = script_helper.assert_python_ok('-m', 'tabnanny', *args) | |||
# Note: The `splitlines()` will solve the problem of CRLF(\r) added | |||
# by OS Windows. | |||
out = out.decode('ascii') | |||
err = err.decode('ascii') | |||
out = out.decode('utf-8') |
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.
I suggest to use os.fsdecode() instead. subprocess uses the locale encoding, it can be different than UTF-8. Moreover, fsdecode() uses the surrogateescape error handler for undecodable bytes.
I confirm that this PR fix https://bugs.python.org/issue44031 Without this PR, the test fails if the Python directory contains Загрузки:
With this PR, it works as expected:
|
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.
LGTM.
@raghavthind2005 FYI - there is a discussion on python-dev about spam activity on GitHub (which wastes our time) and your recent activity on the cpython repo was mentioned there. See this link: https://mail.python.org/archives/list/[email protected]/message/UO6ZSNWLLXWU7AZ7NGQDTOQ2WVX2ZAZN/ |
Thanks @iritkatriel for the PR 🌮🎉.. I'm working now to backport this PR to: 3.9, 3.10. |
(cherry picked from commit 108e66b) Co-authored-by: Irit Katriel <[email protected]>
GH-31047 is a backport of this pull request to the 3.10 branch. |
(cherry picked from commit 108e66b) Co-authored-by: Irit Katriel <[email protected]>
GH-31048 is a backport of this pull request to the 3.9 branch. |
(cherry picked from commit 108e66b) Co-authored-by: Irit Katriel <[email protected]>
GH-31048) (cherry picked from commit 108e66b) Co-authored-by: Irit Katriel <[email protected]> Automerge-Triggered-By: GH:iritkatriel
…-31014) (pythonGH-31048) (cherry picked from commit 108e66b) Co-authored-by: Irit Katriel <[email protected]> Automerge-Triggered-By: GH:iritkatriel
I was able to reproduce the failure on a Mac, and this change fixes it.
https://bugs.python.org/issue44031