summaryrefslogtreecommitdiffstats
path: root/Lib/urllib2.py
diff options
context:
space:
mode:
authorFacundo Batista <facundobatista@gmail.com>2007-04-23 17:08:31 (GMT)
committerFacundo Batista <facundobatista@gmail.com>2007-04-23 17:08:31 (GMT)
commit9fab9f103f21b42ffafc87ff5a4ce970735a7b17 (patch)
tree448fa248d3060f85a6cfc1f9a70eb7434c65d4ea /Lib/urllib2.py
parent9f87128d8b6282e3c1afd2cd08150e5f5de14290 (diff)
downloadcpython-9fab9f103f21b42ffafc87ff5a4ce970735a7b17.zip
cpython-9fab9f103f21b42ffafc87ff5a4ce970735a7b17.tar.gz
cpython-9fab9f103f21b42ffafc87ff5a4ce970735a7b17.tar.bz2
As specified in RFC 2616, 2xx code indicates that the client's
request was successfully received, understood, and accepted. Now in these cases no error is raised. Also fixed tests.
Diffstat (limited to 'Lib/urllib2.py')
-rw-r--r--Lib/urllib2.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/Lib/urllib2.py b/Lib/urllib2.py
index 046470a..7c73f81 100644
--- a/Lib/urllib2.py
+++ b/Lib/urllib2.py
@@ -487,7 +487,9 @@ class HTTPErrorProcessor(BaseHandler):
def http_response(self, request, response):
code, msg, hdrs = response.code, response.msg, response.info()
- if code not in (200, 206):
+ # According to RFC 2616, "2xx" code indicates that the client's
+ # request was successfully received, understood, and accepted.
+ if not (200 <= code < 300):
response = self.parent.error(
'http', request, response, code, msg, hdrs)