[Python-Dev] Incorrect documentation of the raw_input built-in function (original) (raw)

Mike Kent mike.kent at sage.com
Thu Jan 24 20:41:46 CET 2008


<skip pobox.com> writes:

Isaac> Have people actually verified that the prompt is really sent to Isaac> stderr right now by using 2>/dev/null to attempt to suppress it? Good point. On my machine at work (Solaris), Python 2.4 seems to send its rawinput prompt to stdout, not stderr:

Same for 2.6a0 on my Mac at home. Mike, are you sure about it prompting to stderr? If so, what's your setup? Skip

Skip, Guido and others:

Interesting point about whether GNU readline is installed. My setup is RedHat Linux, with Python 2.5 that I built and installed myself. GNU readline is not, in fact, installed. If you look at Python2.5/Parser/myreadline.c, function PyOS_StdioReadline, line 125, you will see that prompt output is being sent to stderr. As best as my Python-fu can determine, this is the code used to output a raw_input prompt (thanks again to Gabriel Genellina for pointing me in the right direction.)

It's entirely likely that the difference in what I am seeing and what you guys are seeing is caused by my not having GNU readline installed. Nevertheless, the behavior without it seems wrong, and is certainly different from the documentation.



More information about the Python-Dev mailing list