1 message in org.python.python-bugs-list[ python-Bugs-912845 ] urllib2 checks...
FromSent OnAttachments
SourceForge.netMar 9, 2004 11:32 am 
Actions with this message:
Paste this link in email or IM:
Paste this link in email or IM:
Atom feed for this thread
Paste this URL into your reader:
Subject:[ python-Bugs-912845 ] urllib2 checks for http return code 200 only.Actions...
From:SourceForge.net (nore@sourceforge.net)
Date:Mar 9, 2004 11:32:08 am
List:org.python.python-bugs-list

Bugs item #912845, was opened at 2004-03-09 18:32 Message generated for change (Tracker Item Submitted) made by Item Submitter You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=912845&group_id=5470

Category: Python Library Group: Python 2.3 Status: Open Resolution: None Priority: 5 Submitted By: Ahmed F. (oneofone) Assigned to: Nobody/Anonymous (nobody) 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

----------------------------------------------------------------------