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 gwk
Recipients gwk
Date 2021-11-26.16:28:02
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1637944082.95.0.645505652849.issue45904@roundup.psfhosted.org>
In-reply-to
Content
Using macOS 11.6 Terminal.app with Python 3.10.0 installed directly from python.org.

I open the REPL. If I enter `char(0xff)` I get back 'ÿ' as expected (U00FF LATIN SMALL LETTER Y WITH DIAERESIS).

However, If I copy this character with surrounding quotes, and then paste it into the REPL, it pastes as '' and evaluates to the empty string.

If I copy it without quotes and then paste into the REPL, I see nothing. When I hit return, the prompt renders as `>>> ^M>>>`. This suggests that the character is getting misinterpreted as a control character or something.

If I paste it into the terminal shell when the Python REPL is not running, it appears as the latin1 letter that I expect.

If I run `python3 -c 'print("ÿ")'` the character prints fine.

It seems to me that the python REPL is setting some terminal mode that fails on this particular character. Perhaps this is a problem with the macOS readline/libedit implementation?

It seems that only U00FF is problematic; U00FE and U01000 both paste in just fine.

I verified that my terminal profile is set to UTF-8 encoding. I also repeated this experiment in the Kitty terminal emulator, and got identical results.


Here is the readline version:
>>> readline._READLINE_LIBRARY_VERSION
'EditLine wrapper'
>>> readline._READLINE_RUNTIME_VERSION
1026
>>> readline._READLINE_VERSION
1026
History
Date User Action Args
2021-11-26 16:28:02gwksetrecipients: + gwk
2021-11-26 16:28:02gwksetmessageid: <1637944082.95.0.645505652849.issue45904@roundup.psfhosted.org>
2021-11-26 16:28:02gwklinkissue45904 messages
2021-11-26 16:28:02gwkcreate