Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.
Sign upbpo-13601: always use line-buffering for sys.stderr #17646
+30
−4
Conversation
This comment has been minimized.
This comment has been minimized.
LGTM, but it would be nice if you could add a test, for example in |
This comment has been minimized.
This comment has been minimized.
Thanks for your comments! I hope my changes address them adequately. |
Lib/test/test_cmd_line.py
Outdated
code = f'import os, sys; {buf}.write({txt1!r}); {buf}.write({txt2!r}); os._exit(0)' | ||
rc, out, err = assert_python_ok('-c', code) | ||
self.assertEqual(out, out_ok) | ||
self.assertEqual(err, err_ok) |
This comment has been minimized.
This comment has been minimized.
vstinner
Dec 19, 2019
Member
I'm not sure that a functional test is required here to validate manually that buffered are flushed properly. Maybe testing the following attributes are enough?
>>> sys.stdout.write_through, sys.stdout.write_through
(False, False)
What do you think @pitrou?
My worry is that functional tests are more likely to fail and so give me more to work to maintain the CI :-)
This comment has been minimized.
This comment has been minimized.
Thanks for the documentation update! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
jendrikseipp commentedDec 17, 2019
•
edited by bedevere-bot
Fixes https://bugs.python.org/issue13601
https://bugs.python.org/issue13601