You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have found two issues with the current release of windows-curses:
The color_content() function fails for any color number above 15, while in an *ix ncurses environment it returns values (although they are not correct values in my testing so far).
The pair_number() function on Windows only returns a value that must be shifted right by 16 bits before it can be used as the argument to the pair_content() function. In an *ix ncurses environment the shift is not required.
For issue 2, if the shift is not done then the program crashes with these error messages at the call to pair_content().
Traceback (most recent call last):
File "C:\test\wincurses-issues.py", line 60, in
curses.wrapper(main)
File "C:\Python38\lib\curses_init_.py", line 105, in wrapper
return func(stdscr, *args, **kwds)
File "C:\test\wincurses-issues.py", line 49, in main
fg, bg = curses.pair_content (pair)
OverflowError: signed short integer is greater than maximum
Code to show the two problems is attached as a *.txt file. Rename to *.py to run the example. Comment out the test for windows and the pair shift to observe the crash.
I have found two issues with the current release of windows-curses:
For issue 2, if the shift is not done then the program crashes with these error messages at the call to pair_content().
Traceback (most recent call last):
File "C:\test\wincurses-issues.py", line 60, in
curses.wrapper(main)
File "C:\Python38\lib\curses_init_.py", line 105, in wrapper
return func(stdscr, *args, **kwds)
File "C:\test\wincurses-issues.py", line 49, in main
fg, bg = curses.pair_content (pair)
OverflowError: signed short integer is greater than maximum
Code to show the two problems is attached as a *.txt file. Rename to *.py to run the example. Comment out the test for windows and the pair shift to observe the crash.
Environments tested:
Win 10-64
Python 3.8.9 (tags/v3.8.9:a743f81, Apr 6 2021, 14:02:34) [MSC v.1928 64 bit (AMD64)]
windows-curses 2.2.0
Ubuntu 20.04 (Win 10 / WSL2)
libncurses6/focal,now 6.2-0ubuntu2 amd64
Peter
wincurses-issues.txt
The text was updated successfully, but these errors were encountered: