[New-bugs-announce] [issue13120] Default nosigint optionto pdb.Pdb() prevents use in non-main thread

Ben Bass report at bugs.python.org
Thu Oct 6 23:17:28 CEST 2011


New submission from Ben Bass <benbass at codedstructure.net>:

The new SIGINT behaviour of pdb.Pdb prevents use of pdb within a non-main thread without explicitly setting nosigint=True. Specifically the 'continue' command causes a traceback as follows:

{{{
...
  File "/Library/Frameworks/Python.framework/Versions/3.2/lib/python3.2/pdb.py", line 959, in do_continue
    signal.signal(signal.SIGINT, self.sigint_handler)
ValueError: signal only works in main thread
}}}

Since the new behaviour seems to be to gain an enhancement rather than anything fundamentally necessary to pdb, wouldn't it be better if the default was reversed, so the same code would work identically on Python 3.1 (and potentially earlier, i.e. Python2) and Python 3.2?

At the moment in my codebase (rpcpdb) I'm using inspect.getargspec sniffing for nosigint on pdb.Pdb.__init__ to determine whether to include a nosigint=True parameter, which clearly isn't ideal!

----------
components: Library (Lib)
messages: 145040
nosy: bpb
priority: normal
severity: normal
status: open
title: Default nosigint optionto pdb.Pdb() prevents use in non-main thread
type: behavior
versions: Python 3.2

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


More information about the New-bugs-announce mailing list