--- /usr/local/lib/python2.5/httplib.py Fri Feb 29 06:43:39 2008 +++ /tmp/httplib.py Wed Apr 16 11:09:31 2008 @@ -545,7 +545,10 @@ class HTTPResponse: i = line.find(';') if i >= 0: line = line[:i] # strip chunk-extensions - chunk_left = int(line, 16) + try: + chunk_left = int(line, 16) + except ValueError: + chunk_left = 0 if chunk_left == 0: break if amt is None: