--- C:\Python31\Lib\http\client.py 2009-07-26 14:39:48.000000000 +-0200 +++ C:\Python31\Lib\http\client.py.patched 2009-09-28 18:48:39.000000000 +-0200 @@ -525,12 +525,16 @@ while True: if chunk_left is None: line = self.fp.readline() i = line.find(b";") 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 try: chunk_left = int(line, 16) except ValueError: # close the connection as protocol synchronisation is # probably lost self.close()