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:
61f16d1
)
Fix python 3 tests.
author
Ian Cordasco
<graffatcolmingov@gmail.com>
Sun, 25 Nov 2012 03:43:52 +0000
(22:43 -0500)
committer
Ian Cordasco
<graffatcolmingov@gmail.com>
Sun, 25 Nov 2012 03:43:52 +0000
(22:43 -0500)
requests/models.py
patch
|
blob
|
history
diff --git
a/requests/models.py
b/requests/models.py
index 4025dae73dc0389137f6b0917ce1f23aface6960..44b41d8e37c8e14ecb678e2c0309652da55816c6 100644
(file)
--- a/
requests/models.py
+++ b/
requests/models.py
@@
-542,7
+542,7
@@
class Request(object):
content_type = 'application/x-www-form-urlencoded'
self.headers['Content-Length'] = '0'
- if
isinstance(body, file
):
+ if
hasattr(body, 'seek') and hasattr(body, 'tell'
):
body.seek(0, 2)
self.headers['Content-Length'] = str(body.tell())
body.seek(0, 0)