Skip to content
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-13601: always use line-buffering for sys.stderr #17646

Open
wants to merge 10 commits into
base: master
from

Conversation

@jendrikseipp
Copy link

jendrikseipp commented Dec 17, 2019

@pitrou

This comment has been minimized.

Copy link
Member

pitrou commented Dec 17, 2019

@pitrou
pitrou approved these changes Dec 17, 2019
Copy link
Member

pitrou left a comment

LGTM, but it would be nice if you could add a test, for example in Lib/test/test_cmd_line.py.

Doc/library/sys.rst Outdated Show resolved Hide resolved
Doc/library/sys.rst Outdated Show resolved Hide resolved
@jendrikseipp

This comment has been minimized.

Copy link
Author

jendrikseipp commented Dec 19, 2019

Thanks for your comments! I hope my changes address them adequately.

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.

Copy link
@vstinner

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.

Copy link
@jendrikseipp

jendrikseipp Dec 20, 2019

Author

I added non-functional tests and removed the functional tests.

Copy link
Member

vstinner left a comment

Thanks for the documentation update!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
5 participants
You can’t perform that action at this time.