mirror of
https://github.com/python/cpython.git
synced 2026-01-05 23:12:38 +00:00
#1929: fix httplib _read_chunked (str/bytes confusion).
This commit is contained in:
parent
a1e7e13966
commit
95ba469626
1 changed files with 2 additions and 2 deletions
|
|
@ -560,14 +560,14 @@ def read(self, amt=None):
|
|||
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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue