[issue42225] Tkinter hangs or crashes when displaying astral chars

Ronald Oussoren report at bugs.python.org
Sun Nov 8 09:20:55 EST 2020


Ronald Oussoren <ronaldoussoren at mac.com> added the comment:

The crash I had on macOS with tk 8.6.8 appears to be gone when using tk 8.6.10.

What I got back was a SyntaxError when pasting a smiley emoji in an IDLE shell window when trying to type execute print("😀").  The SyntaxError message says: 'utf-8' codec can't encode characters in position 7-12: surrogates not allowed.  That's likely to to how Tk represents this character in its text widget, and is something we could work around when converting Tcl/Tk strings to Python strings.

Printing the emoji using 'print(chr(128516))' works fine.

The scriptlet in msg380173 also works.

----------

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


More information about the Python-bugs-list mailing list