bpo-13601: always use line-buffering for sys.stderr (GH-17646)

This commit is contained in:
Jendrik Seipp 2020-01-01 23:21:43 +01:00 committed by Antoine Pitrou
parent 46abfc1416
commit 5b9077134c
5 changed files with 33 additions and 4 deletions

View file

@ -1817,7 +1817,7 @@ create_stdio(const PyConfig *config, PyObject* io,
write_through = Py_True;
else
write_through = Py_False;
if (isatty && buffered_stdio)
if (buffered_stdio && (isatty || fd == fileno(stderr)))
line_buffering = Py_True;
else
line_buffering = Py_False;