diff options
author | ?ukasz Langa <lukasz@langa.pl> | 2017-02-10 00:20:16 -0800 |
---|---|---|
committer | ?ukasz Langa <lukasz@langa.pl> | 2017-02-10 00:20:16 -0800 |
commit | 8972587fab93cd27ac78b4eab3805f5e11164cb9 (patch) | |
tree | 3b6b18367a3054c41f3a186d60c321ef9a08ee38 /Lib/http/client.py | |
parent | c7a3f78cc193bfa7fc874f49ec2e0799b32da817 (diff) | |
parent | 2328d19475109a50de26fa42832a5286824b0391 (diff) | |
download | cpython-8972587fab93cd27ac78b4eab3805f5e11164cb9.tar.gz |
Merge 3.6 (fix #29519)
Diffstat (limited to 'Lib/http/client.py')
-rw-r--r-- | Lib/http/client.py | 10 |
1 files changed, 1 insertions, 9 deletions
diff --git a/Lib/http/client.py b/Lib/http/client.py index a8e59b9561..0234199dfa 100644 --- a/Lib/http/client.py +++ b/Lib/http/client.py @@ -72,7 +72,6 @@ import email.parser import email.message import http import io -import os import re import socket import collections @@ -642,14 +641,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: |