Opened 16 years ago

Closed 16 years ago

Last modified 13 years ago

#8285 closed (fixed)

Signal Handlers can only be functions with DEBUG=True

Reported by: Zal Owned by: nobody
Component: Core (Other) Version: dev
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

Description

When DEBUG=True, signal handlers can only be functions, rather than any callable object. This is because dispatch/dispatcher.py 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 16 years ago.

Download all attachments as: .zip

Change History (7)

by Zal, 16 years ago

Attachment: dispatcher.diff added

comment:1 by Malcolm Tredinnick, 16 years ago

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 by Malcolm Tredinnick, 16 years ago

milestone: 1.0 maybe1.0

comment:3 by Andrew Stoneman, 16 years ago

Component: UncategorizedCore framework

comment:4 by Jacob, 16 years ago

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 by Jacob, 16 years ago

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 by Jacob, 13 years ago

milestone: 1.0

Milestone 1.0 deleted

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