Opened 12 years ago

Closed 12 years ago

Last modified 9 years ago

#8285 closed (fixed)

Signal Handlers can only be functions with DEBUG=True

Reported by: Zal Owned by: nobody
Component: Core (Other) Version: master
Severity: Keywords: signals functions
Cc: Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: yes
Easy pickings: no UI/UX: no


When DEBUG=True, signal handlers can only be functions, rather than any callable object. This is because dispatch/ tries to ensure that signal handlers accept kwargs, using inspect.getargspec. Unfortunately, inspect.getargspec accepts only actual function objects, and not any callable. Thus, the check does more harm than good in cases where the signal handler is not an actual function. I suggest this check simply be removed.

Attachments (1)

dispatcher.diff (646 bytes) - added by Zal 12 years ago.

Download all attachments as: .zip

Change History (7)

Changed 12 years ago by Zal

Attachment: dispatcher.diff added

comment:1 Changed 12 years ago by Malcolm Tredinnick

milestone: 1.0 maybe
Triage Stage: UnreviewedDesign decision needed

I'd like to hear something from jacob or jdunck on this, since they've put the most thinking into this area lately. The goal of at least allowing such things to work is probably reasonable, however.

comment:2 Changed 12 years ago by Malcolm Tredinnick

milestone: 1.0 maybe1.0

comment:3 Changed 12 years ago by Andrew Stoneman

Component: UncategorizedCore framework

comment:4 Changed 12 years ago by Jacob

Patch needs improvement: set
Triage Stage: Design decision neededAccepted

The patch isn't correct at all -- the check is important -- but it is indeed broken.

comment:5 Changed 12 years ago by Jacob

Resolution: fixed
Status: newclosed

(In [8546]) Fixed #8285: signal handlers that aren't functions work under DEBUG. This slightly loosens the sanity check, but things that are valid under production shouldn't fail under debug.

comment:6 Changed 9 years ago by Jacob

milestone: 1.0

Milestone 1.0 deleted

Note: See TracTickets for help on using tickets.
Back to Top