[issue44217] Tkinter/IDLE: literal astral char discombobulates text editing

2021-05-25 Thread Shreyan Avigyan
Shreyan Avigyan added the comment: Sorry, 1.0 and 1.1 refer to  not 1.1 and 1.2 -- ___ Python tracker ___ ___ Python-bugs-list

[issue44217] Tkinter/IDLE: literal astral char discombobulates text editing

2021-05-25 Thread Shreyan Avigyan
Shreyan Avigyan added the comment: I executed the code Tal provided and yes both Serhiy and Tal you're right. It seems the backspace problem is related to Tcl/Tk's indexing. 1.1 and 1.2 both refer to . Also the dancing I told actually tells why this is happening. Since Tcl/Tk uses BMP it

[issue44217] Tkinter/IDLE: literal astral char discombobulates text editing

2021-05-24 Thread Tal Einat
Tal Einat added the comment: > It is partially an IDLE issue. The code expects that indices in Python string > correspond indices in Tcl string, but this is not true in case of astral > characters which are encoded as 2 (or maybe even 4) characters in Tcl. It's not just that - Tk's Text

[issue44217] Tkinter/IDLE: literal astral char discombobulates text editing

2021-05-24 Thread Shreyan Avigyan
Shreyan Avigyan added the comment: The first and third behavior is only occurring for IDLE. I believe the third one is a cause of the first one. The second behavior of dancing is a Tcl/Tk problem. -- ___ Python tracker

[issue44217] Tkinter/IDLE: literal astral char discombobulates text editing

2021-05-24 Thread Erlend E. Aasland
Erlend E. Aasland added the comment: STM like the most reasonable thing to do is to enhance the docs, as Terry suggested. -- ___ Python tracker ___

[issue44217] Tkinter/IDLE: literal astral char discombobulates text editing

2021-05-24 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: It is partially an IDLE issue. The code expects that indices in Python string correspond indices in Tcl string, but this is not true in case of astral characters which are encoded as 2 (or maybe even 4) characters in Tcl. To fix it we need to translate

[issue44217] Tkinter/IDLE: literal astral char discombobulates text editing

2021-05-23 Thread Tal Einat
Tal Einat added the comment: This is at least partly a tcl/tk issue. Using Terry's last example, the Text widget reports that the length of the line is 14 (t.index('1.end') -> '1.14'), despite it only including 11 characters. It appears that each emoji character adds an extra character.

[issue44217] Tkinter/IDLE: literal astral char discombobulates text editing

2021-05-23 Thread Terry J. Reedy
Terry J. Reedy 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