From ee7fe02953d864021298ed8d3e3e5f6aff1f6731 Mon Sep 17 00:00:00 2001 From: Cory Benfield Date: Wed, 12 Mar 2014 18:34:43 +0000 Subject: [PATCH] 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. --- requests/models.py | 1 + 1 file changed, 1 insertion(+) diff --git a/requests/models.py b/requests/models.py index cd232e68..e2fa09f8 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)