]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
#1929: fix httplib _read_chunked (str/bytes confusion).
authorGeorg Brandl <georg@python.org>
Sat, 26 Jan 2008 09:45:58 +0000 (09:45 +0000)
committerGeorg Brandl <georg@python.org>
Sat, 26 Jan 2008 09:45:58 +0000 (09:45 +0000)
Lib/httplib.py

index 2b38e76434353936f5c2af183b93aa18c333622f..932152277afffdd23216c50cd48cc62922c89b32 100644 (file)
@@ -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)