[Python-Dev] raw_input prompt not printed on sys.stderr

Tal Einat taleinat at gmail.com
Tue Jul 7 09:18:00 CEST 2015

On Mon, Jul 6, 2015 at 11:45 PM, Clement Rouault
<clement.rouault at gmail.com> wrote:
> Hi,
> While playing with non-standard sys.stdout/stderr, I noticed that the
> prompt of raw_input was printed on stderr (not sys.stderr) (see
> Parser/myreadline.c:120).
> I found an issue (http://bugs.python.org/issue1927) from 2008 talking
> about changing stderr to stdout. But nobody in the thread seems
> bothered by the use of stdout/err over the ones in the sys module.
> So, is there any good reason I might not be aware of that justifies
> the use of stderr over sys.stderr ?

See issue #24402: input() uses sys.__stdout__ instead of sys.stdout for prompt

That issue was deemed probably a bug, and includes a simple patch
which appears to fix the issue (without tests).

- Tal Einat

More information about the Python-Dev mailing list