Can someone explain this unexpected raw_input behavior?

Mike Kent mrmakent at cox.net
Thu Jan 24 16:04:28 EST 2008


> If it weren't for the documentation...
>
> "If the prompt argument is present, it is written to *standard output*
> without a trailing newline."
>
> --
> mvh Björn

I have reported this issue to the python-dev mailing list, and Guido
agrees that this is a bug in Python.  It turns out that the key is
that my site does not have GNU readline installed, so Python falls
back to its own implementation of readline.  Using GNU readline,
raw_input will write its prompt to stdout.  Python's own
implementation of readline sends the output to stderr.  As Bjorn
states, the documentation for raw_input says it writes its prompt to
stdout.  A bug issue has been opened in the Python Trac system for
this.



More information about the Python-list mailing list