Skip to content
Myr

Merge pull request #1381 from expandrive/master

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Don't force chunked transfer on 0-length file-like object.

authored by Kenneth Reitz · committed by Kenneth Reitz · parents cfd84d7, e7c9bbb · Browse files · 1 file+2 added−2 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+2 added−2 removed

  • other:+2 added−2 removed

1 file+2 added−2 removed

modified:requests/models.py+2 added-2 removed
362 unmodified lines
363364 try:365 length = super_len(data)366 except (TypeError, AttributeError):367 length = False367 length = None368369 if is_stream:370 body = data371372 if files:373 raise NotImplementedError('Streamed bodies and files are mutually exclusive.')374375 if length:375 if length is not None:376 self.headers['Content-Length'] = str(length)377 else:378 self.headers['Transfer-Encoding'] = 'chunked'379 # Check if file, fo, generator, iterator.
307 unmodified lines