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 ronaldoussoren
Recipients ned.deily, ronaldoussoren
Date 2020-11-10.21:22:18
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
As mentioned in msg380552: I get an SyntaxError with message "utf-8' codec can't encode characters in position 7-12: surrogates not allowed." when I paste a smiley emoji in an IDLE interactive shell and try to execute that line, for example using:

>>> print("😀")

The error is likely due to a surrogate pair being present in the UTF-8 representation of a Tcl/Tk string.

It should be possible to work around this in _tkinter.c:unicodeFromTclStringAndSize by merging surrogate pairs. 

This is with:
- Python 3.10
- macOS 11 (arm64)
- Tk 8.6.10

With Tk 8.6.8 (as included in the macOS installers on printing won't work at all, as mentioned in bpo-42225.
Date User Action Args
2020-11-10 21:22:18ronaldoussorensetrecipients: + ronaldoussoren, ned.deily
2020-11-10 21:22:18ronaldoussorensetmessageid: <>
2020-11-10 21:22:18ronaldoussorenlinkissue42318 messages
2020-11-10 21:22:18ronaldoussorencreate