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
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Use subTest().
  • Loading branch information
serhiy-storchaka committed Sep 9, 2018
commit b2790263845aee88faec6243df88e7a60ff2df80
5 changes: 3 additions & 2 deletions Lib/distutils/tests/test_log.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,9 @@ def test_non_ascii(self):
# output as is.
for errors in ('strict', 'backslashreplace', 'surrogateescape',
'replace', 'ignore'):
with NamedTemporaryFile("w+", encoding='cp437', errors=errors) as stdout, \
NamedTemporaryFile("w+", encoding='cp437', errors=errors) as stderr:
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.

old_threshold = log.set_threshold(log.DEBUG)
try:
with swap_attr(sys, 'stdout', stdout), \
Expand Down
0