Django

Code

Ticket #8285 (closed: fixed)

Opened 5 months ago

Last modified 5 months ago

Signal Handlers can only be functions with DEBUG=True

Reported by: Zal Assigned to: nobody
Milestone: 1.0 Component: Core framework
Version: SVN Keywords: signals functions
Cc: Triage Stage: Accepted
Has patch: 1 Needs documentation: 0
Needs tests: 0 Patch needs improvement: 1

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

dispatcher.diff (0.6 kB) - added by Zal on 08/13/08 09:18:04.

Change History

08/13/08 09:18:04 changed by Zal

  • attachment dispatcher.diff added.

08/13/08 13:08:12 changed by mtredinnick

  • needs_better_patch changed.
  • needs_docs changed.
  • stage changed from Unreviewed to Design decision needed.
  • needs_tests changed.
  • milestone set to 1.0 maybe.

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.

08/13/08 13:08:23 changed by mtredinnick

  • milestone changed from 1.0 maybe to 1.0.

08/22/08 12:56:27 changed by astoneman

  • component changed from Uncategorized to Core framework.

08/22/08 19:37:12 changed by jacob

  • needs_better_patch set to 1.
  • stage changed from Design decision needed to Accepted.

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

08/25/08 13:24:05 changed by jacob

  • status changed from new to closed.
  • resolution set to fixed.

(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.


Add/Change #8285 (Signal Handlers can only be functions with DEBUG=True)




Change Properties
Action