From aae6a10e3549c30ad0f27d33c881efa8c498a5fd Mon Sep 17 00:00:00 2001 From: Jeremy Hylton Date: Mon, 30 Jun 2003 15:01:26 +0000 Subject: [PATCH] Backport fix for SF bug 666219. --- Lib/httplib.py | 4 ++++ 1 file changed, 4 insertions(+) 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: -- 2.47.3