cpython/Lib/urllib
Martin Panter 3c0d0baf2b Issue #12319: Support for chunked encoding of HTTP request bodies
When the body object is a file, its size is no longer determined with
fstat(), since that can report the wrong result (e.g. reading from a pipe).
Instead, determine the size using seek(), or fall back to chunked encoding
for unseekable files.

Also, change the logic for detecting text files to check for TextIOBase
inheritance, rather than inspecting the “mode” attribute, which may not
exist (e.g. BytesIO and StringIO).  The Content-Length for text files is no
longer determined ahead of time, because the original logic could have been
wrong depending on the codec and newline translation settings.

Patch by Demian Brecht and Rolf Krahl, with a few tweaks by me.
2016-08-24 06:33:33 +00:00
..
__init__.py
error.py Issue #23887: urllib.error.HTTPError now has a proper repr() representation. 2015-04-22 18:35:54 -03:00
parse.py merge from 3.5 2016-01-25 18:54:37 -08:00
request.py Issue #12319: Support for chunked encoding of HTTP request bodies 2016-08-24 06:33:33 +00:00
response.py Issue #23865: close() methods in multiple modules now are idempotent and more 2015-04-10 13:24:41 +03:00
robotparser.py Merge typo fixes from 3.5 2016-05-08 14:02:35 +00:00