#32969: Improve pickling of HttpResponse instances
--------------------------------------+------------------------------------
Reporter: zatro | Owner: H. White
Type: Cleanup/optimization | Status: assigned
Component: HTTP handling | Version: dev
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
--------------------------------------+------------------------------------
Changes (by H. White):
* has_patch: 0 => 1
Comment:
PR, https://github.com/django/django/pull/21289
Several classes associated with HTTP handling have attributes that
reference objects that can't be pickled. Previous fixes have tried
removing the attributes that won't pickle, but since the attributes
weren't replaced, copied or unpickled objects were missing them.
This PR adds {{{__getstate__}}} and {{{__setstate__}}} methods to these
classes, allowing instances to serialize and deserialize properly. I see
that this approach was discussed for #23895
(https://github.com/django/django/pull/14664), and rejected because the
urlconf could have changed after the object was pickled. However, the
unpicklable objects are only present in responses created by the test
client, and the reason for their inclusion is documented.
--
Ticket URL: <https://code.djangoproject.com/ticket/32969#comment:20>
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 visit
https://groups.google.com/d/msgid/django-updates/0107019e2e2d8a82-41d99ae5-575b-4e6d-96ac-90fb44e888e2-000000%40eu-central-1.amazonses.com.