From: Cory Benfield Date: Wed, 12 Mar 2014 18:34:43 +0000 (+0000) Subject: Ensure that .raw() is present after unpickling. X-Git-Tag: v2.3.0~4^2~4^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=ee7fe02953d864021298ed8d3e3e5f6aff1f6731;p=services%2Fpython-requests.git Ensure that .raw() is present after unpickling. Some people will assume that .raw() is present, and they shouldn't get AttributeErrors when they make that assumption on a pickled Response. However, @kennethreitz has asked that we not be too dependent on urllib3. For that reason, set to None. --- diff --git a/requests/models.py b/requests/models.py index cd232e6..e2fa09f 100644 --- a/requests/models.py +++ b/requests/models.py @@ -575,6 +575,7 @@ class Response(object): # pickled objects do not have .raw setattr(self, '_content_consumed', True) + setattr(self, 'raw', None) def __repr__(self): return '' % (self.status_code)