STINNER Victor <victor.stin...@haypocalc.com> added the comment:

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).

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue8256>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to