[Python-Dev] Incorrect documentation of the raw_input built-in function

Guido van Rossum guido at python.org
Thu Jan 24 21:09:12 CET 2008


On Jan 24, 2008 11:41 AM, Mike Kent <mike.kent at sage.com> wrote:
>  <skip <at> 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
> > raw_input 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.

Agreed.

-- 
--Guido van Rossum (home page: http://www.python.org/~guido/)


More information about the Python-Dev mailing list