[Python-Dev] Incorrect documentation of the raw_input built-in function
Guido van Rossum
guido at python.org
Thu Jan 24 19:47:46 CET 2008
Beware: this may depend on whether GNU readline is enabled or not --
under many circumstances, raw_input() calls GNU readline instead of
using sys.stdin/stdout.
I do agree that if there are any conditions where it uses stderr
instead of stdout those are mistakes.
On Jan 24, 2008 9:47 AM, <skip at pobox.com> wrote:
>
> 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:
>
> % python
> Python 2.4.2 (#1, Feb 23 2006, 12:48:31)
> [GCC 3.4.1] on sunos5
> Type "help", "copyright", "credits" or "license" for more information.
> >>> raw_input("?")
> ?z
> 'z'
> >>>
> ink% python 2>/dev/null
> >>> raw_input("?")
> ?sdf
> 'sdf'
> >>> ink% python >/dev/null
> Python 2.4.2 (#1, Feb 23 2006, 12:48:31)
> [GCC 3.4.1] on sunos5
> Type "help", "copyright", "credits" or "license" for more information.
> >>> raw_input("?")
> wer
> >>> ^D
>
> 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
>
> _______________________________________________
> Python-Dev mailing list
> Python-Dev at python.org
> http://mail.python.org/mailman/listinfo/python-dev
> Unsubscribe: http://mail.python.org/mailman/options/python-dev/guido%40python.org
>
--
--Guido van Rossum (home page: http://www.python.org/~guido/)
More information about the Python-Dev
mailing list