summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>1998-01-19 22:25:24 (GMT)
committerGuido van Rossum <guido@python.org>1998-01-19 22:25:24 (GMT)
commit29c4688659577ffa12698dadef7de47dd784a5f3 (patch)
tree3aa8f5d3dbc092c9907f68400dc70b796eeba022 /Lib
parent42e8e5d16481c65c595faae73ae54fca0b905fd2 (diff)
downloadcpython-29c4688659577ffa12698dadef7de47dd784a5f3.zip
cpython-29c4688659577ffa12698dadef7de47dd784a5f3.tar.gz
cpython-29c4688659577ffa12698dadef7de47dd784a5f3.tar.bz2
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
Diffstat (limited to 'Lib')
-rw-r--r--Lib/httplib.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/Lib/httplib.py b/Lib/httplib.py
index 7081bd1..05289b3 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