summaryrefslogtreecommitdiffstats
path: root/Doc/whatsnew
diff options
context:
space:
mode:
authorMartin Panter <vadmium+py@gmail.com>2016-08-27 01:39:26 (GMT)
committerMartin Panter <vadmium+py@gmail.com>2016-08-27 01:39:26 (GMT)
commitef91bb26604ddfae22aac56b3cfdaabf237db37a (patch)
tree491cbeadc0488a4e203de39ca42f8b132653195f /Doc/whatsnew
parent8f96a30630b5f6a984af3ee53c63bce3b16077e0 (diff)
downloadcpython-ef91bb26604ddfae22aac56b3cfdaabf237db37a.zip
cpython-ef91bb26604ddfae22aac56b3cfdaabf237db37a.tar.gz
cpython-ef91bb26604ddfae22aac56b3cfdaabf237db37a.tar.bz2
Issue #12319: Always send file request bodies using chunked encoding
The previous attempt to determine the file’s Content-Length gave a false positive for pipes on Windows. Also, drop the special case for sending zero-length iterable bodies.
Diffstat (limited to 'Doc/whatsnew')
-rw-r--r--Doc/whatsnew/3.6.rst11
1 files changed, 9 insertions, 2 deletions
diff --git a/Doc/whatsnew/3.6.rst b/Doc/whatsnew/3.6.rst
index ff3861b..6ef82d4 100644
--- a/Doc/whatsnew/3.6.rst
+++ b/Doc/whatsnew/3.6.rst
@@ -579,8 +579,8 @@ The :class:`~unittest.mock.Mock` class has the following improvements:
urllib.request
--------------
-If a HTTP request has a non-empty body but no Content-Length header
-and the content length cannot be determined up front, rather than
+If a HTTP request has a file or iterable body (other than a
+bytes object) but no Content-Length header, rather than
throwing an error, :class:`~urllib.request.AbstractHTTPHandler` now
falls back to use chunked transfer encoding.
(Contributed by Demian Brecht and Rolf Krahl in :issue:`12319`.)
@@ -935,6 +935,13 @@ Changes in the Python API
This behavior has also been backported to earlier Python versions
by Setuptools 26.0.0.
+* In the :mod:`urllib.request` module and the
+ :meth:`http.client.HTTPConnection.request` method, if no Content-Length
+ header field has been specified and the request body is a file object,
+ it is now sent with HTTP 1.1 chunked encoding. If a file object has to
+ be sent to a HTTP 1.0 server, the Content-Length value now has to be
+ specified by the caller. See :issue:`12319`.
+
Changes in the C API
--------------------