Changes between Initial Version and Version 1 of Ticket #13222, comment 28


Ignore:
Timestamp:
Oct 22, 2012, 5:11:10 PM (12 years ago)
Author:
Aymeric Augustin

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #13222, comment 28

    initial v1  
    1 This commit broke pickling of `HttpResponse` objects :(
     1This commit broke pickling of `HttpResponse` objects :( Possible solution:
     2
     3{{{
     4--- a/django/http/response.py
     5+++ b/django/http/response.py
     6@@ -260,9 +260,10 @@ class HttpResponse(HttpResponseBase):
     7         else:
     8             self._container = [value]
     9             self._base_content_is_iter = False
     10-        self._iterator = iter(self._container)
     11 
     12     def __iter__(self):
     13+        if not hasattr(self, '_iterator'):
     14+            self._iterator = iter(self._container)
     15         return self
     16 
     17     def __next__(self):
     18}}}
Back to Top