projects
/
services
/
python-requests.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
03f444e
)
Ensure that .raw() is present after unpickling.
author
Cory Benfield
<lukasaoz@gmail.com>
Wed, 12 Mar 2014 18:34:43 +0000
(18:34 +0000)
committer
Cory Benfield
<lukasaoz@gmail.com>
Wed, 12 Mar 2014 18:34:43 +0000
(18:34 +0000)
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
patch
|
blob
|
history
diff --git
a/requests/models.py
b/requests/models.py
index cd232e68094869a68bde81c729cf2e42fb9e6039..e2fa09f8cefa31960d3a6c48844adecbb2423146 100644
(file)
--- 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 '<Response [%s]>' % (self.status_code)