A combining mark in a `Textbox`'s last cell loses the base character
Nessuno ha ancora preso questa issue.
- Lingua principale
- Python
- Stelle
- 77.2k
- Fork
- 35.9k
- Metriche di merge delle PR
- Metriche PR in attesa
Descrizione
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
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Direzione di ricerca
Inizia con curses.textpad.Textbox.do_command e riproduci il problema usando l'esempio fornito a tre colonne e a dieci colonne su Linux. Controlla Doc/library/curses.rst per il comportamento Unicode dichiarato; completato quando entrambe le finestre preservano il carattere di base e il segno combinante come 'abe\u0301'.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- python
- Ambito
- cli
- Tipo di issue
- Bug
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Stato di attività
- Ferma
- Chiarezza
- Specificata chiaramente
- Idoneità per principianti
- 35/100