summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeremy Hylton <jeremy@alum.mit.edu>2003-06-30 15:01:26 +0000
committerJeremy Hylton <jeremy@alum.mit.edu>2003-06-30 15:01:26 +0000
commitb86a52d52b9a81ab7e9958c9b6693ae1eb377db2 (patch)
tree623234f7b3626996fe1296a161748a99798e8fe9
parent120e991aa88971edace23048471df86b5a4e1c25 (diff)
downloadcpython-b86a52d52b9a81ab7e9958c9b6693ae1eb377db2.tar.gz
Backport fix for SF bug 666219.
-rw-r--r--Lib/httplib.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/Lib/httplib.py b/Lib/httplib.py
index bb4ab7aa75..34e95438a3 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: