[Django] #34973: Allow making unpickling warnings an error

12 views
Skip to first unread message

Django

unread,
Nov 17, 2023, 5:42:00 AM11/17/23
to django-...@googlegroups.com
#34973: Allow making unpickling warnings an error
-------------------------------------+-------------------------------------
Reporter: | Owner: nobody
stefan6419846 |
Type: New | Status: new
feature |
Component: Database | Version: 4.2
layer (models, ORM) |
Severity: Normal | Keywords:
Triage Stage: | Has patch: 0
Unreviewed |
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
-------------------------------------+-------------------------------------
In #21430 (https://github.com/django/django/commit/42736ac), unpickling
has been changed to log a warning for incompatible versions. While this
raises awareness, this is not really practical if you have lots of
deployments to consider.

We are using mostly automated deployments to quickly provide the latest
changes to our customers. Whenever we update to a newer Django, we need to
clear the whole cache. Automating this requires special handling, as
running the cache invalidation on every deployment seems to be overkill
for unrelated updates - thus some custom logic is required to only force
an invalidation on Django package changes when necessary at the moment.

For this reason, I would like to propose an additional/changed solution
which turns this into hard failures which can be handled by my application
without having to invalidate the cache itself. This way, I am able to
cleanly detect this and handle it appropriately.

Due to being a backwards-incompatible change, this might be changed by a
new setting which defaults to the old behavior.

--
Ticket URL: <https://code.djangoproject.com/ticket/34973>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Nov 17, 2023, 6:08:00 AM11/17/23
to django-...@googlegroups.com
#34973: Allow making unpickling warnings an error
-------------------------------------+-------------------------------------
Reporter: stefan6419846 | Owner: nobody
Type: New feature | Status: closed
Component: Database layer | Version: 4.2
(models, ORM) |
Severity: Normal | Resolution: wontfix
Keywords: | Triage Stage:
| Unreviewed
Has patch: 0 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Mariusz Felisiak):

* status: new => closed
* resolution: => wontfix


Comment:

Thanks for the report, however you should be able to make these warnings
errors using `warnings.filterwarnings()`. There is no need to change
anything in Django itself.

--
Ticket URL: <https://code.djangoproject.com/ticket/34973#comment:1>

Reply all
Reply to author
Forward
0 new messages