Drekin added the comment:

I have found another problem. PyOS_Readline can be called from two different 
places – from Parser/tokenizer.c:tok_nextc (by REPL), which uses 
sys.stdin.encoding to encode prompt argument, and from 
Python/bltinmodule.c:builtin_input_impl (by input() function), which uses 
sys.stdout.encoding. So readline hook cannot be implemented correctly if 
sys.stdin and sys.stdout don't have the same encoding.

Either the tokenizer should have two encodings – one for input and one for 
output - or better no encoding at all and should use Python string based 
alternative to PyOS_Readline, which could be added.

----------

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

Reply via email to