urllib2 - 403 that _should_ not occur.

James Mills prologic at shortcircuit.net.au
Sun Jan 11 20:59:00 EST 2009


Hey all,

The following fails for me:

>>> from urllib2 import urlopen
>>> f = urlopen("http://groups.google.com/group/chromium-announce/feed/rss_v2_0_msgs.xml")
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib/python2.6/urllib2.py", line 124, in urlopen
    return _opener.open(url, data, timeout)
  File "/usr/lib/python2.6/urllib2.py", line 389, in open
    response = meth(req, response)
  File "/usr/lib/python2.6/urllib2.py", line 502, in http_response
    'http', request, response, code, msg, hdrs)
  File "/usr/lib/python2.6/urllib2.py", line 427, in error
    return self._call_chain(*args)
  File "/usr/lib/python2.6/urllib2.py", line 361, in _call_chain
    result = func(*args)
  File "/usr/lib/python2.6/urllib2.py", line 510, in http_error_default
    raise HTTPError(req.get_full_url(), code, msg, hdrs, fp)
urllib2.HTTPError: HTTP Error 403: Forbidden
>>>

However, that _same_ url works perfectly fine on the
same machine (and same network) using any of:
 * curl
 * wget
 * elinks
 * firefox

Any helpful ideas ?

cheers
James

--
-- "Problems are solved by method"



More information about the Python-list mailing list