Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork32k
gh-134210: handle signals in_curses.window.getch
#134326
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
base:main
Are you sure you want to change the base?
Conversation
vstinner commentedMay 20, 2025 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
I tried this change with the script: fromcursesimportwrapperimportctypesdefmain(window):window.nodelay(True)returnwindow.getch()print(wrapper(main)) Before (without this change), it displays After (with this change), it fails with the exception: So this change is backward incompatible. Is it deliberate? |
picnixz commentedMay 20, 2025 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
Hum. No it's not meant to be broken! Only the signals should be handled, but otherwise we shouldn't raise an exception. |
picnixz commentedMay 20, 2025 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
Now I am bit conflicted. Ideally, we should return -1 for everythingor raise an exception as in the other functions. I don't know why it was historically chosen to return -1 for However, since I don't want to break stuff, I don't know how we can make a smooth transition, except by raising a warning before returning -1. |
Uh oh!
There was an error while loading.Please reload this page.
_curses.window.getch
does not check for interruption signals as_curses.window.{getkey,get_wch}
do #134210