summaryrefslogtreecommitdiff
path: root/django/http
diff options
context:
space:
mode:
authorMariusz Felisiak <felisiak.mariusz@gmail.com>2023-04-12 09:46:18 +0200
committerMariusz Felisiak <felisiak.mariusz@gmail.com>2023-04-12 18:53:29 +0200
commit791407fef16faa4da6fe2247c24a9055037dd5dd (patch)
tree15fe68bf50bbf6ad4fdf1e83b2af959946aa38fd /django/http
parent2feb9333e7044df348c45417d23ee20b08c1a7fd (diff)
[4.2.x] Refs #34482 -- Reverted "Fixed #32969 -- Fixed pickling HttpResponse and subclasses."
This reverts commit d7f5bfd241666c0a76e90208da1e9ef81aec44db. Thanks Márton Salomváry for the report. Backport of 173034b00589c083793d495e8b07e35be2cb1cf0 from main
Diffstat (limited to 'django/http')
-rw-r--r--django/http/response.py19
1 files changed, 0 insertions, 19 deletions
diff --git a/django/http/response.py b/django/http/response.py
index 090be181e2..ea3114170e 100644
--- a/django/http/response.py
+++ b/django/http/response.py
@@ -369,31 +369,12 @@ class HttpResponse(HttpResponseBase):
"""
streaming = False
- non_picklable_attrs = frozenset(
- [
- "resolver_match",
- # Non-picklable attributes added by test clients.
- "asgi_request",
- "client",
- "context",
- "json",
- "templates",
- "wsgi_request",
- ]
- )
def __init__(self, content=b"", *args, **kwargs):
super().__init__(*args, **kwargs)
# Content is a bytestring. See the `content` property methods.
self.content = content
- def __getstate__(self):
- obj_dict = self.__dict__.copy()
- for attr in self.non_picklable_attrs:
- if attr in obj_dict:
- del obj_dict[attr]
- return obj_dict
-
def __repr__(self):
return "<%(cls)s status_code=%(status_code)d%(content_type)s>" % {
"cls": self.__class__.__name__,