From: Georg Brandl Date: Sat, 26 Jan 2008 09:45:58 +0000 (+0000) Subject: #1929: fix httplib _read_chunked (str/bytes confusion). X-Git-Tag: v3.0a3~161 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=95ba46962636c1925341120da30f124b1c4ef670;p=thirdparty%2FPython%2Fcpython.git #1929: fix httplib _read_chunked (str/bytes confusion). --- diff --git a/Lib/httplib.py b/Lib/httplib.py index 2b38e7643435..932152277aff 100644 --- a/Lib/httplib.py +++ b/Lib/httplib.py @@ -560,14 +560,14 @@ class HTTPResponse: def _read_chunked(self, amt): assert self.chunked != _UNKNOWN chunk_left = self.chunk_left - value = "" + value = b"" # XXX This accumulates chunks by repeated string concatenation, # which is not efficient as the number or size of chunks gets big. while True: if chunk_left is None: line = self.fp.readline() - i = line.find(";") + i = line.find(b";") if i >= 0: line = line[:i] # strip chunk-extensions chunk_left = int(line, 16)