[issue22742] IDLE shows traceback when printing non-BMP character

Serhiy Storchaka report at bugs.python.org
Fri Oct 4 07:59:57 EDT 2019


Serhiy Storchaka <storchaka+cpython at gmail.com> added the comment:

It was fixed for all valid Unicode characters, you can still get an error when print a surrogate character to the stderr on Linux:

>>> import sys
>>> print('\ud800', file=sys.stderr)
Traceback (most recent call last):
  File "<pyshell#4>", line 1, in <module>
    print('\ud800', file=sys.stderr)
UnicodeEncodeError: 'utf-8' codec can't encode character '\ud800' in position 0: surrogates not allowed

In the Python REPL you get an escaped sequence.

>>> import sys
>>> print('\ud800', file=sys.stderr)
\ud800

----------
resolution: fixed -> 
stage: resolved -> 
status: closed -> open

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue22742>
_______________________________________


More information about the Python-bugs-list mailing list