Code

Opened 6 years ago

Closed 6 years ago

Last modified 3 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: UI/UX:

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 6 years ago.

Download all attachments as: .zip

Change History (7)

Changed 6 years ago by Zal

comment:1 Changed 6 years ago by mtredinnick

  • milestone set to 1.0 maybe
  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Triage Stage changed from Unreviewed to Design 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 6 years ago by mtredinnick

  • milestone changed from 1.0 maybe to 1.0

comment:3 Changed 6 years ago by astoneman

  • Component changed from Uncategorized to Core framework

comment:4 Changed 6 years ago by jacob

  • Patch needs improvement set
  • Triage Stage changed from Design decision needed to Accepted

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

comment:5 Changed 6 years ago by jacob

  • Resolution set to fixed
  • Status changed from new to closed

(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 3 years ago by jacob

  • milestone 1.0 deleted

Milestone 1.0 deleted

Add Comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
as The resolution will be set. Next status will be 'closed'
The resolution will be deleted. Next status will be 'new'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.