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 martin.panter
Recipients Arfrever, brett.cannon, doko, ezio.melotti, martin.panter, nadeem.vawda, petri.lehtinen, python-dev, serhiy.storchaka, vstinner
Date 2016-01-18.11:33:43
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
I don’t think this affects Python 2. The failing tests were added in revision 421c8e291221, Issue 13342, for 3.2+ only. They invole input() doing text decoding. AFAIK Python 2’s equivalent, raw_input(), does not do text decoding.

I suspect we can’t really change how Readline handles text encoding errors, which seems to be what Nadeem was trying to do. I suggest to just fix the tests without changing Readline.

As far as I know there is no way to un-register the Readline module once it has been loaded. A quick and dirty workaround might be to skip the test(s) if the Readline has been loaded ("readline" in sys.modules). But a better fix would probably be to run the test in a subprocess, where we can start a new interpreter from scratch and control whether Readline is loaded.

Looking closer at the tests, they mention invoking Gnu Readline. But the associated bug fix is in the wrapper code around PyOS_Readline(), which may call Gnu Readline if it is loaded, or may call a simpler internal routine otherwise. So ideally the tests should be repeated with Readline unloaded and loaded.

Also, the comment for test_input_tty_non_ascii() implies it is testing UTF-8 encoding. But the data is not valid UTF-8 so it ends up testing the error handling. I think that test should use valid UTF-8 input.
Date User Action Args
2016-01-18 11:33:44martin.pantersetrecipients: + martin.panter, brett.cannon, doko, vstinner, nadeem.vawda, ezio.melotti, Arfrever, python-dev, petri.lehtinen, serhiy.storchaka
2016-01-18 11:33:44martin.pantersetmessageid: <>
2016-01-18 11:33:44martin.panterlinkissue13886 messages
2016-01-18 11:33:43martin.pantercreate