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

This is fundamentally a tk text widget issue.  Prior to fall 2019, attempts to 
insert an astral (non-BMP) chars in tkinter widgets raised a unicode decode 
exception.  Then Serhiy fixed tkinter so that such chars could be displayed, 
either as the actual chars or as a replacement box for unavailable chars.  
There were 2 remaining problems:

1. The presence of the literal astral char in an editable widget, especially a 
Text widget, make editing past the char weird.  It can be demonstrated with, 
for instance, the following.

import tkinter as tk
r = tk.Tk()
t.insert = tk.Text(r); t.pack()
t.insert('insert', "a😀b'a😀b'a😀b)\n"

We decided that beings able to output such chars to the view-only part of shell 
more than made up for confusion such as Shreyan experienced.

Re-experimenting now, it appears that the behavior is worse in IDLE.  In 
particular, backspace delete does not work (nothing happens).  IDLE intercepts 
<backspace> in order to invoke its smart backspace routine.  I will try to find 
out why nothing happens.  Whatever the result, the behavior should be better 
documented.

The 8.7a3 was released Nov 2019, so I have no idea how soon 8.7 will arrive.  
Maybe the devs found enough bugs to work on, especially on Mac.  And then 
8.6.11 was needed to have tcl/tk work on the new Apple hardware and OS version.

2. On some Linux systems with some fonts with some XWindows, attempts to 
display some colored chars (such as particular emoji), in color, causes an 
XWindows error ('too complex').  This is a Linux-Xwindows-font bug.

----------
nosy: +taleinat
title: [IDLE] Weird behaviour in IDLE when printing non-BMP unicode characters 
-> Tkinter/IDLE: literal astral char discombobulates text editing

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

Reply via email to