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.
Could you use 8 spaces instead of 5 here?
There was a problem hiding this comment.
These lines are already too long. I don't want neither make them longer, nor split.
There was a problem hiding this comment.
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.
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