Message105616
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). |
|
Date |
User |
Action |
Args |
2010-05-13 00:14:26 | vstinner | set | recipients:
+ vstinner, amaury.forgeotdarc, belopolsky, dangyogi, r.david.murray, gruszczy, flox |
2010-05-13 00:14:26 | vstinner | set | messageid: <1273709666.24.0.195793955891.issue8256@psf.upfronthosting.co.za> |
2010-05-13 00:14:24 | vstinner | link | issue8256 messages |
2010-05-13 00:14:22 | vstinner | create | |
|