You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Lib/curses/textpad.py shifts and reads the window one cell at a time, so a double-width (East Asian) character, which occupies two cells, is mishandled in three ways: insert mode duplicates it and drops a character from the line, gather() reports every one of them twice, and typing one whose second cell would fall in the last column raises curses.error.
insert 漢 before 'abc': '\u6f22ac'
typed '你好', window: '\u4f60\u597d'
typed '你好', gather(): '\u4f60\u4f60\u597d\u597d'
'你好' into 4 columns: curses.error: wadd_wch() (called by addch()) returned ERR
Expected: '漢abc' from the insert, gather() equal to the window's own '你好', and no exception in the last case. Doc/library/curses.rst says of Textbox that "Entering and reading back the full Unicode range, including combining characters, is now supported when curses is built with wide-character support".
Activity
gh-156207: Fix curses Textbox.gather() for double-width characters (G…
pythongh-156207: Fix curses Textbox.gather() for double-width charact…