This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author vstinner
Recipients amaury.forgeotdarc, belopolsky, dangyogi, flox, gruszczy, r.david.murray, vstinner
Date 2010-05-14.11:31:06
SpamBayes Score 0.008995967
Marked as misclassified No
Message-id <201005141331.00888.victor.stinner@haypocalc.com>
In-reply-to <1273836072.9.0.854375793727.issue8256@psf.upfronthosting.co.za>
Content
amaury> since the prompt is written to stderr, why is sys.stdout.encoding
amaury> used instead of sys.stderr.encoding?

input() calls PyOS_Readline() but PyOS_Readline() has multiple 
implementations:
 - PyOS_StdioReadline() if sys_stdin or sys_stdout is not a TTY
 - or PyOS_ReadlineFunctionPointer callback:
   - vms__StdioReadline() (VMS only)
   - PyOS_StdioReadline()
   - call_readline() when readline module is loaded

call_readline() calls rl_callback_handler_install() with the prompt which 
writes the prompt to *stdout* (try ./python 2>/dev/null).

I don't think that it really matters that the prompt is written to stderr with 
stdout encoding, because both outputs always use the same encoding.
History
Date User Action Args
2010-05-14 11:31:08vstinnersetrecipients: + vstinner, amaury.forgeotdarc, belopolsky, dangyogi, r.david.murray, gruszczy, flox
2010-05-14 11:31:06vstinnerlinkissue8256 messages
2010-05-14 11:31:06vstinnercreate