From: Guido van Rossum Date: Mon, 19 Jan 1998 22:25:24 +0000 (+0000) Subject: Patch by Tim O'Malley for servers that send a response looking just like X-Git-Tag: v1.5.1~932 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=29c4688659577ffa12698dadef7de47dd784a5f3;p=thirdparty%2FPython%2Fcpython.git Patch by Tim O'Malley for servers that send a response looking just like HTTP/1.x 200 instead of HTTP/1.x 200 OK --- diff --git a/Lib/httplib.py b/Lib/httplib.py index 7081bd105d10..05289b3da16b 100644 --- a/Lib/httplib.py +++ b/Lib/httplib.py @@ -123,8 +123,12 @@ class HTTP: try: [ver, code, msg] = string.split(line, None, 2) except ValueError: - self.headers = None - return -1, line, self.headers + try: + [ver, code] = string.split(line, None, 1) + msg = "" + except ValueError: + self.headers = None + return -1, line, self.headers if ver[:5] != 'HTTP/': self.headers = None return -1, line, self.headers