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.01:20:12
SpamBayes Score 2.944776e-05
Marked as misclassified No
Message-id <201005140317.33456.victor.stinner@haypocalc.com>
In-reply-to <1273709714.4.0.35932325802.issue8256@psf.upfronthosting.co.za>
Content
Here is a patch catching the _PyUnicode_AsString() error.

input() uses sys.stdout.encoding to encode the prompt to a byte string, but 
PyOS_StdioReadline() writes the prompt to stderr (it should use sys_stdout).

I don't know which encoding should be used if sys.stdout.encoding is None (eg. 
if sys.stdout is a StringIO() object).

StringIO() of _io module has no encoding because it stores unicode characters, 
not bytes. StringIO() of _pyio module is based on BytesIO() and use utf8 
encoding, but the reference implementation is now _io.
Files
File name Uploaded
input_stdout_encoding.patch vstinner, 2010-05-14.01:20:12
History
Date User Action Args
2010-05-14 01:20:16vstinnersetrecipients: + vstinner, amaury.forgeotdarc, belopolsky, dangyogi, r.david.murray, gruszczy, flox
2010-05-14 01:20:13vstinnerlinkissue8256 messages
2010-05-14 01:20:12vstinnercreate