Kaydet (Commit) 95ba4696 authored tarafından Georg Brandl's avatar Georg Brandl

#1929: fix httplib _read_chunked (str/bytes confusion).

üst a1e7e139
......@@ -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)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment