Unbuffered stderr in Python 3

Random832 random832 at fastmail.com
Wed Nov 4 08:43:56 EST 2015


Wolfgang Maier <wolfgang.maier at biologie.uni-freiburg.de> writes:
> Standard I/O streams are line-buffered only if interactive (i.e.,
> connected to a console), but block-buffered otherwise.

That's not appropriate for stderr, nor is it justified by the argument
that Terry Reedy cited earlier. I had assumed he was making an implicit
claim that stderr is _always_ line-buffered, _even if_ it is not
interactive.

> What does sys.stderr.isatty() return?

There are many situations in which a nominally interactive process might
not have a "tty" for stderr on MS Windows. In an Emacs M-x shell buffer,
in a cygwin terminal (for a non-cygwin python), etc.




More information about the Python-list mailing list