[issue36630] failure of test_colors_funcs in test_curses with ncurses 6.1

Jeffrey Kintscher report at bugs.python.org
Sun May 19 21:07:14 EDT 2019


Jeffrey Kintscher <websurfer at surf2c.net> added the comment:

The test fails because curses.pair_content(curses.COLOR_PAIRS-1) validates its parameter against the limits for signed short (max 32767) while curses.COLOR_PAIRS-1 has the value 65535.

Unfortunately, re-plumbing curses.pair_content() to use signed integers instead of signed shorts and replacing the underlying ncurses API call from pair_content() to extended_pair_content() doesn't fix the problem because extended_pair_content() still fails when passed 65535. Tracing into the ncurses 6.1 source code, I found that start_color() clamps the maximum number of color pairs at SHRT_MAX (32767) regardless of the number of color pairs supported by the terminal.

----------
nosy: +websurfer5
Added file: https://bugs.python.org/file48338/extended_pair_content.c

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue36630>
_______________________________________


More information about the Python-bugs-list mailing list