]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Backport fix for SF bug 666219.
authorJeremy Hylton <jeremy@alum.mit.edu>
Mon, 30 Jun 2003 15:01:26 +0000 (15:01 +0000)
committerJeremy Hylton <jeremy@alum.mit.edu>
Mon, 30 Jun 2003 15:01:26 +0000 (15:01 +0000)
Lib/httplib.py

index bb4ab7aa75bee7644d3905ed4a4610a957fef5b3..34e95438a3d6e67bccd02c4f1861a59a6a3c97c6 100644 (file)
@@ -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: