summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2007-09-24 18:08:24 (GMT)
committerGeorg Brandl <georg@python.org>2007-09-24 18:08:24 (GMT)
commit9b915673b78b62cef82626ab4e580c35ae7ff3e1 (patch)
tree9d1cc89804e1e83947e186a6e72a9e9b40b24a92 /Lib
parente4186252b1134eb629bff347aa4c4c5630f0df36 (diff)
downloadcpython-9b915673b78b62cef82626ab4e580c35ae7ff3e1.zip
cpython-9b915673b78b62cef82626ab4e580c35ae7ff3e1.tar.gz
cpython-9b915673b78b62cef82626ab4e580c35ae7ff3e1.tar.bz2
#1177: accept 2xx responses for https too, not only http.
Diffstat (limited to 'Lib')
-rw-r--r--Lib/urllib.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/Lib/urllib.py b/Lib/urllib.py
index 96115fbe..ad0e72b 100644
--- a/Lib/urllib.py
+++ b/Lib/urllib.py
@@ -435,7 +435,9 @@ class URLopener:
# something went wrong with the HTTP status line
raise IOError, ('http protocol error', 0,
'got a bad status line', None)
- if errcode == 200:
+ # According to RFC 2616, "2xx" code indicates that the client's
+ # request was successfully received, understood, and accepted.
+ if not (200 <= errcode < 300):
return addinfourl(fp, headers, "https:" + url)
else:
if data is None: