--- C:\Python26\Lib\httplib.py 2009-03-03 00:46:12.000000000 +-0200 +++ C:\Python26\Lib\httplib.py.patched 2009-09-28 18:43:10.000000000 +-0200 @@ -551,12 +551,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 try: chunk_left = int(line, 16) except ValueError: # close the connection as protocol synchronisation is # probably lost self.close()