diff options
author | Sean Reifscheider <jafo@tummy.com> | 2007-09-19 07:52:56 (GMT) |
---|---|---|
committer | Sean Reifscheider <jafo@tummy.com> | 2007-09-19 07:52:56 (GMT) |
commit | a1afbf617d0a7dd33632f3666c7e0fab8e88febf (patch) | |
tree | c4edeaee42054aa0d8f07ed9cbdde6d299c72c8d /Lib/urllib.py | |
parent | 5a5bc7b10d679368cfa66e77b7b4ba7068bc190d (diff) | |
download | cpython-a1afbf617d0a7dd33632f3666c7e0fab8e88febf.zip cpython-a1afbf617d0a7dd33632f3666c7e0fab8e88febf.tar.gz cpython-a1afbf617d0a7dd33632f3666c7e0fab8e88febf.tar.bz2 |
issue1177: Ported Facundo's from urllib2 to urllib, accepting 2xx responses.
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 5f3ec3c..96115fbe 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: |