[issue13153] IDLE 3.x on Windows exits when pasting non-BMP unicode

Terry J. Reedy report at bugs.python.org
Fri Oct 4 01:02:50 EDT 2019


Terry J. Reedy <tjreedy at udel.edu> added the comment:

A week ago, I thought that the astral solution was to always replace with the \U escape.  With this patch, we can and should send them to read-only text windows, and let the OS and font display it or a substitute.  On Windows, at least, the emoji which beginners most often want to use get displayed.

Elsewhere, we will have to check and do some follow-up patches.  For using file names with astral chars results, on Windows, in six large boxes, and when the file is saved, it is saved in a new file with the boxes, not the original file.  Such file names are not added to the recent files list, or maybe list boxes cannot handle them.

Code is another issue.  Astral chars in files could be replaced when read.  Unfortunately, I believe some are legal identifier chars.  On the clipboard, on Windows, astral chars become sequences of 6 surrogates.

>>> r.clipboard_clear()
>>> r.clipboard_append('🚀')
>>> r.clipboard_get()
'\udced\udca0\udcbd\udced\udcba\udc80'

Perhaps we should try to intercept paste and replace such sequences with the \U escape.

----------

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


More information about the Python-bugs-list mailing list