Terry J. Reedy <tjre...@udel.edu> added the comment:

On my puzzlement above: repr(s) is a string of 3 characters -- s bracketed by 
quote characters.  print(repr(s)) fails.  I am not sure how s gets expanded to 
the full escape in IDLE.  ascii(s) expands all non-ascii and adds extra quotes. 
 Need to check Shell code.

In the python REPL, astral chars are not expanded to escape sequences.

>>> s='\U0001f603'
>>> s
'😃'  # Windows REPL shows two replacement boxes instead of 😃


#36698 is about astral chars in exceptions messages.

>>> raise Exception(s)

results in the Exception traceback, 3 Unicodedecode tracebacks, and a restart.

----------
versions: +Python 3.8 -Python 3.6

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

Reply via email to