[issue17620] Python interactive console doesn't use sys.stdin for input

Drekin report at bugs.python.org
Sat Aug 30 17:30:25 CEST 2014


Drekin added the comment:

Antoine Pitrou: I understand. It would be nice to have that new Python string based readline hook. Its default implementation could be to call PyOS_Readline and decode the bytes using sys.stdin.encoding (as the tokenizer currently does). Tokenizer then woudn't need to decode if it called the new hook.

Victor Stinner: I'm going to try the approach of reencoding my stream to UTF-8. So then my UTF-16-LE encoded stream is decoded, then encoded to UTF-8, interpreted as null-terminated *char, which is returned to the tokenizer, which again decodes it and encodes to UTF-8. I wonder if the last step could be short-circuited. What is this UTF8 flag to Python parser? I couldn't find any information.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue17620>
_______________________________________


More information about the Python-bugs-list mailing list