--- C:\Python25\Lib\httplib.py.orig 2008-02-12 20:48:24.000000000 +-0200 +++ C:\Python25\Lib\httplib.py.patched 2009-09-28 18:30:33.000000000 +-0200 @@ -542,12 +542,16 @@ while True: if chunk_left is None: line = self.fp.readline() i = line.find(';') if i >= 0: line = line[:i] # strip chunk-extensions + # handle ill-formed response not ended with 0 chunk-size + line = line.strip() + if not line: + break chunk_left = int(line, 16) if chunk_left == 0: break if amt is None: value += self._safe_read(chunk_left) elif amt < chunk_left: