New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Incorrect range checks/documentation in curses #86847
Comments
The description of color_pair starts with curses.color_pair(color_number) It should be curses.color_pair(pair_number) |
Please explain why you believe this is a mistake. |
Good catch! And it is not only documentation issue now. Since color numbers and pair numbers use different range checks, this prevents using this function with pair numbers larger that COLORS (should be accepted up to COLOR_PAIRS-1). Seems there is also other bug which prevents using pair number 0 (constant white on black). |
This change seems to broke some buildbots. For instance: https://buildbot.python.org/all/#/builders/119/builds/153 ====================================================================== Traceback (most recent call last):
File "/home/dje/cpython-buildarea/3.8.edelsohn-rhel8-z/build/Lib/test/test_curses.py", line 310, in test_colors_funcs
curses.pair_content(min(curses.COLOR_PAIRS - 1, 0x7fff))
_curses.error: Argument 1 was out of range. (1..COLOR_PAIRS-1) Ran 28 tests in 0.337s |
Yep, see also bpo-42789. |
Well, a simple documentation issue has grown into large and complex changes that fix several bugs.
|
Thanks a lot Serhiy for the fantastic work! |
Great work, thank you Serhiy! |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: