Message 148439 - Python tracker (original) (raw)

I confirm the bug. But I don't think disabling Ctrl-C (SIGINT) handling by default is a good idea. Proper Ctrl-C support seems like a fundamental feature for a command line debugger.

However, I think the bug is easily fixable w/o changing SIGINT handling. Basically, just put try/except around signal.signal, catch the ValueError and proceed. Would this approach solve your problem?

Patch attached.

PS. and here is a small program demonstrating the bug (just run it and execute "c" command at pdb prompt)

import threading import pdb

def start_pdb(): pdb.Pdb().set_trace() x = 1 y = 1

t = threading.Thread( target=start_pdb) t.start()