diff options
Diffstat (limited to 'Lib/urllib.py')
| -rw-r--r-- | Lib/urllib.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/Lib/urllib.py b/Lib/urllib.py index 04fd50a6ca..b2542fce24 100644 --- a/Lib/urllib.py +++ b/Lib/urllib.py @@ -357,7 +357,9 @@ class URLopener: raise IOError('http protocol error', 0, 'got a bad status line', None) - if response.status == 200: + # According to RFC 2616, "2xx" code indicates that the client's + # request was successfully received, understood, and accepted. + if not (200 <= response.status < 300): return addinfourl(response.fp, response.msg, "http:" + url) else: return self.http_error( |
