Bugs item #912845, was opened at 2004-03-09 11:32
Message generated for change (Comment added) made by heresiarch
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=912845&group_id=5470
Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Python Library
Group: Python 2.3
Status: Closed
Resolution: Fixed
Priority: 5
Submitted By: Ahmed F. (oneofone)
Assigned to: A.M. Kuchling (akuchling)
Summary: urllib2 checks for http return code 200 only.
Initial Comment:
from urllib2 import *
req = Request("http://someurl/page.html",
headers={'range: bytes=%s':'20-40'})
result = urlopen(req)
will die with something like :
File "/usr/lib/python2.3/urllib2.py", line 306, in
_call_chain
result = func(*args)
File "/usr/lib/python2.3/urllib2.py", line 412, in
http_error_default
raise HTTPError(req.get_full_url(), code, msg,
hdrs, fp)
urllib2.HTTPError: HTTP Error 206: Partial Content
line 892 in {PATH}/urllib2.py should be changed from :
if code == 200:
to
if code in [200, 206]:
peace
----------------------------------------------------------------------
Comment By: Drew (heresiarch)
Date: 2006-06-04 20:19
Message:
Logged In: YES
user_id=1534250
While it's good that 200 and 206 are not considered errors,
what about 201-205? Per the HTTP RFC
(http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.2)
all 2xx codes should be considered successful responses and
probably shouldn't trigger errors.
Thanks!
----------------------------------------------------------------------
Comment By: A.M. Kuchling (akuchling)
Date: 2004-06-29 08:19
Message:
Logged In: YES
user_id=11375
Applied to CVS; thanks!
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=912845&group_id=5470
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com