From: Jeremy Hylton Date: Mon, 30 Jun 2003 15:01:26 +0000 (+0000) Subject: Backport fix for SF bug 666219. X-Git-Tag: 2.2~49 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=aae6a10e3549c30ad0f27d33c881efa8c498a5fd;p=thirdparty%2FPython%2Fcpython.git Backport fix for SF bug 666219. --- diff --git a/Lib/httplib.py b/Lib/httplib.py index bb4ab7aa75be..34e95438a3d6 100644 --- a/Lib/httplib.py +++ b/Lib/httplib.py @@ -231,6 +231,10 @@ class HTTPResponse: line = self.fp.readline() if self.debuglevel > 0: print "reply:", repr(line) + if not line: + # Presumably, the server closed the connection before + # sending a valid response. + raise BadStatusLine(line) try: [version, status, reason] = line.split(None, 2) except ValueError: