homepage

This issue tracker has been migrated to GitHub , and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author takluyver
Recipients minrk, takluyver
Date 2015年02月04日.23:50:49
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1423093850.42.0.241477195496.issue23395@psf.upfronthosting.co.za>
In-reply-to
Content
In tracking down an obscure error we were seeing, we boiled it down to this test case for thread.interrupt_main():
import signal, threading, _thread, time
signal.signal(signal.SIGINT, signal.SIG_DFL) # or SIG_IGN
def thread_run():
 _thread.interrupt_main()
t = threading.Thread(target=thread_run)
t.start()
time.sleep(10)
This fails with an error message "TypeError: 'int' object is not callable", and a traceback completely disconnected from the cause of the error, presumably because it's not coming from the usual Python stack.
The problem appears to be that interrupt_main sets (in the C code) Handlers[SIGINT].tripped, which is only expected to occur when the handler is a Python function. When PyErr_CheckSignals() runs, it tries to call Handlers[SIGINT].func as a Python function, but it's a Python integer, causing the error.
I think the fix for this is to check what Handlers[sig_num].func is, either in trip_signal() before setting Handlers[sig_num].tripped, or in PyErr_CheckSignals before calling it. I can work on a patch if desired, but I'm not brilliant at C.
History
Date User Action Args
2015年02月04日 23:50:50takluyversetrecipients: + takluyver, minrk
2015年02月04日 23:50:50takluyversetmessageid: <1423093850.42.0.241477195496.issue23395@psf.upfronthosting.co.za>
2015年02月04日 23:50:50takluyverlinkissue23395 messages
2015年02月04日 23:50:49takluyvercreate

AltStyle によって変換されたページ (->オリジナル) /