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-13.00:14:22
SpamBayes Score 6.652291e-05
Marked as misclassified No
Message-id <1273709666.24.0.195793955891.issue8256@psf.upfronthosting.co.za>
In-reply-to
Content
This issue is directly related to issue #6697. The first problem is that the builtin input() function doesn't check that _PyUnicode_AsString() result is not NULL.

The second problem is that io.StringIO().encoding is None. I don't understand why it is None whereas it uses utf8 (it calls TextIOWrapper constructor with encodings="utf8" and errors="strict").

I will be difficult to write an unit test because the issue only occurs if stdin and stdout are TTY: input() calls PyOS_Readline(stdin, stdout, prompt). 

--

@gruszczy: You're patch is just a workaround, not the right fix. The problem should be fixed in input(), not in PyUnicode methods. _PyUnicode_AsString() expects an unicode argument, it should raise an error if the argument is None (and not return a magical value).
History
Date User Action Args
2010-05-13 00:14:26vstinnersetrecipients: + vstinner, amaury.forgeotdarc, belopolsky, dangyogi, r.david.murray, gruszczy, flox
2010-05-13 00:14:26vstinnersetmessageid: <1273709666.24.0.195793955891.issue8256@psf.upfronthosting.co.za>
2010-05-13 00:14:24vstinnerlinkissue8256 messages
2010-05-13 00:14:22vstinnercreate