-
-
Notifications
You must be signed in to change notification settings - Fork 32.1k
bpo-34421: Improve distutils logging for non-ASCII strings. #9126
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-34421: Improve distutils logging for non-ASCII strings. #9126
Conversation
Use "backslashreplace" instead of "unicode-escape". It is not implementation depended and escapes only non-encodable characters. Also simplify the code.
'replace', 'ignore'): | ||
with self.subTest(errors=errors), \ | ||
NamedTemporaryFile("w+", encoding='cp437', errors=errors) as stdout, \ | ||
NamedTemporaryFile("w+", encoding='cp437', errors=errors) as stderr: |
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.
Could you use 8 spaces instead of 5 here?
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.
These lines are already too long. I don't want neither make them longer, nor split.
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.
Does it fit with 6 spaces? I just feel a little uneasy when there is only one space difference between two indent levels.
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.
No, it doesn't fit even with 0 spaces. And I don't want to use negative indentation.
5 space indentation for with
is acceptable by PEP 8.
Thanks @serhiy-storchaka for the PR 🌮🎉.. I'm working now to backport this PR to: 3.6, 3.7. |
GH-9503 is a backport of this pull request to the 3.7 branch. |
GH-9504 is a backport of this pull request to the 3.6 branch. |
…thonGH-9126) Use "backslashreplace" instead of "unicode-escape". It is not implementation depended and escapes only non-encodable characters. Also simplify the code. (cherry picked from commit 4b860fd) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
…-9126) (pythonGH-9506) Use "backslashreplace" instead of "unicode-escape". It is not implementation depended and escapes only non-encodable characters. Also simplify the code. (cherry picked from commit 4b860fd) (cherry picked from commit c73df53) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Use "backslashreplace" instead of "unicode-escape". It is not
implementation depended and escapes only non-encodable characters.
Also simplify the code.
https://bugs.python.org/issue34421