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 Drekin
Recipients Drekin, benjamin.peterson, brett.cannon, eric.araujo, georg.brandl, gvanrossum, ncoghlan, pitrou, steve.dower, tshepang, vstinner
Date 2014-09-15.19:04:15
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1410807856.0.0.951089450221.issue17620@psf.upfronthosting.co.za>
In-reply-to
Content
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.
History
Date User Action Args
2014-09-15 19:04:16Drekinsetrecipients: + Drekin, gvanrossum, brett.cannon, georg.brandl, ncoghlan, pitrou, vstinner, benjamin.peterson, eric.araujo, tshepang, steve.dower
2014-09-15 19:04:15Drekinsetmessageid: <1410807856.0.0.951089450221.issue17620@psf.upfronthosting.co.za>
2014-09-15 19:04:15Drekinlinkissue17620 messages
2014-09-15 19:04:15Drekincreate