Index: httplib.py =================================================================== --- httplib.py (revision 42250) +++ httplib.py (working copy) @@ -522,7 +522,7 @@ ### note: we shouldn't have any trailers! while True: line = self.fp.readline() - if line == '\r\n': + if line.strip() == '': break # we read everything; close the "file"