From 19e3b2c7566b506c852595e850e24f0612b8a0c6 Mon Sep 17 00:00:00 2001 From: Martin Panter Date: Fri, 21 Oct 2016 00:52:04 +0000 Subject: Issue #23214: Remove BufferedReader.read1(-1) workaround --- Lib/http/client.py | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) (limited to 'Lib/http/client.py') diff --git a/Lib/http/client.py b/Lib/http/client.py index a8e59b9561..59237a3b31 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: -- cgit v1.2.1 From 71671fce07c5e1a483970ddcd92895d834bd7e08 Mon Sep 17 00:00:00 2001 From: Serhiy Storchaka Date: Fri, 16 Dec 2016 20:00:15 +0200 Subject: Remove unused imports. --- Lib/http/client.py | 1 - 1 file changed, 1 deletion(-) (limited to 'Lib/http/client.py') diff --git a/Lib/http/client.py b/Lib/http/client.py index 59237a3b31..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 -- cgit v1.2.1