A combining mark in a `Textbox`'s last cell loses the base character
Dieses Issue hat noch niemand übernommen.
- Vorherrschende Sprache
- Python
- Sterne
- 77.2k
- Forks
- 35.9k
- PR-Merge-Kennzahlen
- PR-Kennzahlen ausstehend
Beschreibung
Bug description:
Typing a combining mark into the lower-right cell of a curses.textpad.Textbox puts the mark in a cell of its own and pushes the character it should attach to off the window edge, so that character is lost. The same keystrokes one column earlier attach the mark correctly. 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".
import curses, sys
from curses.textpad import Textbox
def typed(ncols):
win = curses.newwin(1, ncols, 0, 0)
box = Textbox(win)
for ch in 'abe\u0301': # COMBINING ACUTE ACCENT after the 'e'
box.do_command(ch)
return win.instr(0, 0, 40).decode()
out = curses.wrapper(lambda stdscr: (typed(3), typed(10)))
print('3 columns: %a\n10 columns: %a' % out, file=sys.stderr)
Output:
3 columns: 'ab\u0301'
10 columns: 'abe\u0301 '
Expected 'abe\u0301' from both windows: the mark should join the e instead of taking its cell.
CPython versions tested on:
CPython main branch
Operating systems tested on:
Linux
Linked PRs
- gh-157211
Beitragsleitfaden
Erste Schritte
- Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
- Forke das Repository und arbeite in einem Branch.
- Öffne einen Pull Request, der die Issue-Nummer nennt.
Rechercherichtung
Beginne mit curses.textpad.Textbox.do_command und reproduziere das Problem anhand des bereitgestellten Beispiels mit drei Spalten und zehn Spalten unter Linux. Prüfe Doc/library/curses.rst auf das angegebene Unicode-Verhalten; abgeschlossen, wenn beide Fenster das Basiszeichen und das kombinierende Zeichen als 'abe\u0301' beibehalten.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- python
- Bereich
- cli
- Issue-Typ
- Bug
- Schwierigkeit
- 3/5
- Geschätzter Aufwand
- 1-2 Tage
- Aktivitätsstatus
- Veraltet
- Klarheit
- Klar beschrieben
- Anfängerfreundlichkeit
- 35/100