summaryrefslogtreecommitdiff
path: root/Lib
diff options
context:
space:
mode:
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 5f3ec3c160..96115fbe50 100644
--- a/Lib/urllib.py
+++ b/Lib/urllib.py
@@ -340,7 +340,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, "http:" + url)
else:
if data is None: