8000 bpo-34421: Improve distutils logging for non-ASCII strings. by serhiy-storchaka · Pull Request #9126 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

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

Merged

Conversation

serhiy-storchaka
Copy link
Member
@serhiy-storchaka serhiy-storchaka commented Sep 9, 2018

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

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

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?

Copy link
Member Author

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.

Copy link
Member

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.

Copy link
Member Author

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.

@serhiy-storchaka serhiy-storchaka merged commit 4b860fd into python:master Sep 23, 2018
@miss-islington
Copy link
Contributor

Thanks @serhiy-storchaka for the PR 🌮🎉.. I'm working now to backport this PR to: 3.6, 3.7.
🐍🍒⛏🤖

@serhiy-storchaka serhiy-storchaka deleted the distutils-log-encoding-error branch September 23, 2018 06:13
miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Sep 23, 2018
…-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>
@bedevere-bot
Copy link

GH-9503 is a backport of this pull request to the 3.7 branch.

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Sep 23, 2018
…-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>
@bedevere-bot
Copy link

GH-9504 is a backport of this pull request to the 3.6 branch.

serhiy-storchaka added a commit to serhiy-storchaka/cpython that referenced this pull request Sep 23, 2018
…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>
serhiy-storchaka added a commit that referenced this pull request Sep 23, 2018
…GH-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)
miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Sep 23, 2018
…-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>
miss-islington added a commit that referenced this pull request Sep 23, 2018
…GH-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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
skip news type-bug An unexpected behavior, bug, or error
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants
0