summaryrefslogtreecommitdiffstats
path: root/Lib/http
diff options
context:
space:
mode:
authorMartin Panter <vadmium+py@gmail.com>2016-10-21 00:52:04 (GMT)
committerMartin Panter <vadmium+py@gmail.com>2016-10-21 00:52:04 (GMT)
commit741d4940fed82b3d80f8948b99adc787b48549f4 (patch)
tree6c5bc2fad5904a101b1e02e6cd765f9da7cc6919 /Lib/http
parentccb2c0e31056de091abdd62fc07ca6e4bb052f24 (diff)
downloadcpython-741d4940fed82b3d80f8948b99adc787b48549f4.zip
cpython-741d4940fed82b3d80f8948b99adc787b48549f4.tar.gz
cpython-741d4940fed82b3d80f8948b99adc787b48549f4.tar.bz2
Issue #23214: Remove BufferedReader.read1(-1) workaround
Diffstat (limited to 'Lib/http')
-rw-r--r--Lib/http/client.py9
1 files changed, 1 insertions, 8 deletions
diff --git a/Lib/http/client.py b/Lib/http/client.py
index a8e59b9..59237a3 100644
--- a/Lib/http/client.py
+++ b/Lib/http/client.py
@@ -642,14 +642,7 @@ class HTTPResponse(io.BufferedIOBase):
return self._read1_chunked(n)
if self.length is not None and (n < 0 or n > self.length):
n = self.length
- try:
- result = self.fp.read1(n)
- except ValueError:
- if n >= 0:
- raise
- # some implementations, like BufferedReader, don't support -1
- # Read an arbitrarily selected largeish chunk.
- result = self.fp.read1(16*1024)
+ result = self.fp.read1(n)
if not result and n:
self._close_conn()
elif self.length is not None: