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

Keith Thompson Keith.S.Thompson+u at gmail.com
Tue Jan 3 13:45:46 EST 2023


MRAB <python at mrabarnett.plus.com> writes:
[...]
> The purpose of stderr is to display status messages, logging and error
> messages, even user prompts, and not mess up the program's actual 
> output. This is important on a *nix system where you might be piping
> the output of one program into the input of another.

I would expect user prompts to be written to stdout, or perhaps to some
system-specific stream like the current tty, not to stderr.  If a
program has user prompts, it probably doesn't make sense to pipe its
output to the input of another.

-- 
Keith Thompson (The_Other_Keith) Keith.S.Thompson+u at gmail.com
Working, but not speaking, for XCOM Labs
void Void(void) { Void(); } /* The recursive call of the void */


More information about the Python-list mailing list