Great. It works in master. The script prints, and if I press c, it
exits, and what was printed is

Going to start
/Users/aaronmeurer/Documents/pudb/pudb/__init__.py:154: UserWarning:
setting interrupt handler on signal 2 failed: ['Traceback (most recent
call last):\n', '  File
"/Users/aaronmeurer/Documents/pudb/pudb/__init__.py", line 148, in
set_interrupt_handler\n    signal.signal(interrupt_signal,
_interrupt_handler)\n', 'ValueError: signal only works in main
thread\n']
  % (interrupt_signal, format_exception(sys.exc_info())))

never gets here

Aaron Meurer

On Thu, Apr 11, 2013 at 3:58 PM, Christopher Trudeau
<[email protected]> wrote:
> I'm not the original poster but I have this problem doing django development
> all the time.  This script should trigger the issue without the need for a
> web runner to show the problem:
>
> import threading
>
> class MyThread(threading.Thread):
>     def run(self):
>         import pudb; pudb.set_trace()
>         print 'never gets here'
>
> print 'Going to start'
> t = MyThread()
> t.start()
>
>
> On Thu, Apr 11, 2013 at 10:15 AM, Aaron Meurer <[email protected]> wrote:
>>
>> On Apr 11, 2013, at 2:32 AM, Sundance <[email protected]> wrote:
>>
>> > On Wed, Apr 10, 2013 at 11:07:44AM -0600, Aaron Meurer wrote:
>> >
>> >> The documentation already says this.
>> >
>> > I may have missed it. Neither the README on PyPI nor the README on
>> > GitHub appear to mention it.
>>
>> The docstring of set_interrupt_handler mentions it. I had previously
>> thought that it just wouldn't work, not that it would crash, so I
>> didn't give it much focus.
>>
>> >
>> >> I just thought that it would fail only if the signal was actually
>> >> sent. I didn't realize it would crash pudb just by setting the
>> >> handler!
>> >
>> > Apparently, it's a Python 'feature'. The ability to bind signals from
>> > non-main threads varies depending on the underlying platform, and in
>> > order to behave the same everywhere, Python just goes and forbids it
>> > altogether. Even if the threading implementation on /your/ platform
>> > would allow it. Meh.
>> >
>> >> Can you give a basic script to reproduce your error?
>> >
>> > Err, I'm not the person who submitted that bug report.
>> >
>> > -- S.
>>
>> Oh.  Well, original poster, can you give a basic script?
>>
>> Aaron Meurer
>>
>> _______________________________________________
>> Pudb mailing list
>> [email protected]
>> http://lists.tiker.net/listinfo/pudb
>
>

_______________________________________________
Pudb mailing list
[email protected]
http://lists.tiker.net/listinfo/pudb

Reply via email to