[ python-Bugs-1687125 ] cannot catch KeyboardInterrupt when using curses getkey()

SourceForge.net noreply at sourceforge.net
Fri Mar 23 21:50:12 CET 2007


Bugs item #1687125, was opened at 2007-03-23 20:50
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1687125&group_id=5470

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Python Library
Group: Python 2.5
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: al65536 (al65536)
Assigned to: Nobody/Anonymous (nobody)
Summary: cannot catch KeyboardInterrupt when using curses getkey() 

Initial Comment:
#!/usr/bin/python
import curses

# Will works
scr=curses.initscr()
key=-1
try:
    try:
        key=scr.getkey()
    except:
        pass
except KeyboardInterrupt:
    key="CTRL-C"
curses.endwin()
print key

# Will fail
scr=curses.initscr()
key=-1
try:
    key=scr.getkey()
except KeyboardInterrupt:
    key="CTRL-C"
curses.endwin()
print key

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1687125&group_id=5470


More information about the Python-bugs-list mailing list