A combining mark in a `Textbox`'s last cell loses the base character
Nadie ha tomado este issue todavía.
- Lenguaje dominante
- Python
- Estrellas
- 77.2k
- Forks
- 35.9k
- Métricas de merge de PR
- Métricas de PR pendientes
Descripción
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
Guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Línea de trabajo
Comienza con curses.textpad.Textbox.do_command y reproduce el problema utilizando el ejemplo proporcionado de tres columnas y diez columnas en Linux. Comprueba Doc/library/curses.rst para conocer el comportamiento de Unicode indicado; terminado cuando ambas ventanas conserven el carácter base y la marca combinante como 'abe\u0301'.
Escrito por el modelo de indexación a partir del texto del issue.
Evaluación
- Stack tecnológico
- python
- Área
- cli
- Tipo de issue
- Error
- Dificultad
- 3/5
- Tiempo estimado
- 1-2 días
- Estado de actividad
- Estancado
- Claridad
- Bien especificado
- Aptitud para principiantes
- 35/100