summaryrefslogtreecommitdiff
path: root/Lib/http/client.py
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2013-12-17 21:50:02 +0200
committerSerhiy Storchaka <storchaka@gmail.com>2013-12-17 21:50:02 +0200
commit1c84ac1f5528d26cb226210c2843b765efae83a4 (patch)
tree616a012d374352ea0f114d63fc565f69c8f8989d /Lib/http/client.py
parent48d761e2b4b8cef40349aa286f6f46fc6c6d0fa7 (diff)
downloadcpython-git-1c84ac1f5528d26cb226210c2843b765efae83a4.tar.gz
Issue #20007: HTTPResponse.read(0) no more prematurely closes connection.
Original patch by Simon Sapin.
Diffstat (limited to 'Lib/http/client.py')
-rw-r--r--Lib/http/client.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/Lib/http/client.py b/Lib/http/client.py
index cc452e2f52..e05c84dab7 100644
--- a/Lib/http/client.py
+++ b/Lib/http/client.py
@@ -544,7 +544,7 @@ class HTTPResponse(io.RawIOBase):
# connection, and the user is reading more bytes than will be provided
# (for example, reading in 1k chunks)
n = self.fp.readinto(b)
- if not n:
+ if not n and b:
# Ideally, we would raise IncompleteRead if the content-length
# wasn't satisfied, but it might break compatibility.
self._close_conn()