projects
/
platform
/
upstream
/
python-requests.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
00ab8fb
)
Only switch to chunked if we don't know the length of a file like object. This fixes...
author
Jeff Mancuso
<jmancuso@gmail.com>
Thu, 23 May 2013 15:21:29 +0000
(11:21 -0400)
committer
Jeff Mancuso
<jmancuso@gmail.com>
Thu, 23 May 2013 15:21:29 +0000
(11:21 -0400)
requests/models.py
patch
|
blob
|
history
diff --git
a/requests/models.py
b/requests/models.py
index 6cf2aaa1a6c8b69dd7b5f8d7e26066e4055c9883..d894d9ffcffb31c93ede4c1d23c6fc7b785861de 100644
(file)
--- a/
requests/models.py
+++ b/
requests/models.py
@@
-364,7
+364,7
@@
class PreparedRequest(RequestEncodingMixin, RequestHooksMixin):
try:
length = super_len(data)
except (TypeError, AttributeError):
- length =
Fals
e
+ length =
Non
e
if is_stream:
body = data
@@
-372,7
+372,7
@@
class PreparedRequest(RequestEncodingMixin, RequestHooksMixin):
if files:
raise NotImplementedError('Streamed bodies and files are mutually exclusive.')
- if length:
+ if length
is not None
:
self.headers['Content-Length'] = str(length)
else:
self.headers['Transfer-Encoding'] = 'chunked'