diff options
author | Andrew M. Kuchling <amk@amk.ca> | 2004-06-29 13:19:19 (GMT) |
---|---|---|
committer | Andrew M. Kuchling <amk@amk.ca> | 2004-06-29 13:19:19 (GMT) |
commit | 08c08bb3d1758d6d3bd884ed7c0d6ef8f8524897 (patch) | |
tree | 0a61976f8c26cea6270e39567e0286500afbb316 /Lib/urllib2.py | |
parent | 31352c5a304cef1d972aba6e6ec61e89dcadde21 (diff) | |
download | cpython-08c08bb3d1758d6d3bd884ed7c0d6ef8f8524897.zip cpython-08c08bb3d1758d6d3bd884ed7c0d6ef8f8524897.tar.gz cpython-08c08bb3d1758d6d3bd884ed7c0d6ef8f8524897.tar.bz2 |
[Bug #912845] urllib2 only checks for a 200 return code, but 206 is also legal if a Range: header was supplied.
(Actually, should the first 'if' statement be modified to allow any 2xx status code?)
Diffstat (limited to 'Lib/urllib2.py')
-rw-r--r-- | Lib/urllib2.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Lib/urllib2.py b/Lib/urllib2.py index 301b5de..69f5e04 100644 --- a/Lib/urllib2.py +++ b/Lib/urllib2.py @@ -468,7 +468,7 @@ class HTTPErrorProcessor(BaseHandler): def http_response(self, request, response): code, msg, hdrs = response.code, response.msg, response.info() - if code != 200: + if code not in (200, 206): response = self.parent.error( 'http', request, response, code, msg, hdrs) @@ -996,7 +996,7 @@ class AbstractHTTPHandler(BaseHandler): except socket.error, err: # XXX what error? raise URLError(err) - if r.status == 200: + if r.status in (200, 206): # Pick apart the HTTPResponse object to get the addinfourl # object initialized properly resp = addinfourl(r.fp, r.msg, req.get_full_url()) |