What should go to stdout/stderr and why Python logging write everything to stderr?

Eryk Sun eryksun at gmail.com
Tue Jan 3 15:29:44 EST 2023


On 1/3/23, Weatherby,Gerard <gweatherby at uchc.edu> wrote:
> If sys.stdout is a tty, it typically flushes on newline. e. g.

Sorry if I wasn't clear. Yes, a tty file will be buffered, but it's
line buffering, which isn't an issue as long as lines are written to
stdout. I was referring to full buffering of pipe and disk files. This
can be a problem when printing diagnostics. We went the information
written to the file immediately, not whenever the buffer happens to
fill up. Thus sys.stderr is unbuffered.


More information about the Python-list mailing list