[issue26531] Keyboard Interrupts not caught when used within a class method on Windows 10

Joshua Cannell report at bugs.python.org
Thu Mar 10 12:00:47 EST 2016


Joshua Cannell added the comment:

Hi,

Thanks for the quick response.

I tried your code, it doesn't capture the keyboard interrupt, so the method doesn't seem to be needed. Also, the code doesn't carry on if interrupt was received, but instead produces the stack traceback. For example:

while True:
    try:
        data = raw_input()
        print data
    except KeyboardInterrupt:
        print "Interrupt!"
    
Does not print "data" if a KeyboardInterrupt is received during raw_input.

Unfortunately, I can't use python 3 as my organization currently uses 2 in their production environment.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue26531>
_______________________________________


More information about the Python-bugs-list mailing list