#35801: Signals are dispatched to receivers associated with dead senders
------------------------------+------------------------------------
Reporter: bobince | Owner: (none)
Type: Bug | Status: new
Component: Core (Other) | Version: 5.1
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
------------------------------+------------------------------------
Comment (by bobince):
> Right, I would suggest receivers_called.clear()
(Ha ha, what is this crazy new-fangled API? Oh... Python 3.3 you say.
well. huh!)
> Would you like to prepare a patch?
Here's a candidate fix:
https://github.com/bobince/django/compare/main..signals_from_dead_senders
It raises some questions about what to do when ‘sender’ isn't weakreffable
— which admittedly is uncommon, and would already break if ‘use_caching’,
but there's no doc that rules it out as far as I can see. In this commit
it quietly falls back to making a strong reference, which would _probably_
be better than the buggy behaviour, but is still a change in behaviour.
So would certainly appreciate thoughts from someone familiar with the
background of dispatch before PR'ing.
--
Ticket URL: <https://code.djangoproject.com/ticket/35801#comment:4>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/0107019261cb695b-8eb3b8cd-4853-4388-b514-d62c091561aa-000000%40eu-central-1.amazonses.com.