BUG URLLIB2

Michael Hudson mwh at python.net
Fri Nov 15 06:27:48 EST 2002


"JohnJacob" <JJ at JJ.com> writes:

> "John Hunter" <jdhunter at nitace.bsd.uchicago.edu> wrote in message
> news:m2lm3vhcg0.fsf at mother.paradise.lost...
> > >>>>> "bart" == bart  <e_viola at libero.it> writes:
> >
> >     bart> I'm an italian student and my problem consists about
> >     bart> urllib2; urlopen function, sometimes, give me old (and
> >     bart> inexactly) url because the site has moved in a new location
> >     bart> but urlopen doesn't undestand it and return 403 error
> >     bart> FORBIDDEN.
> >
> > I don't think you can describe this as a bug; it's a feature!  python
> > provides exceptions to handle, well, exceptional circumstances, such
> > as trying to access a web site that you are forbidden to access.  When
> > this happens, an 'exception' is raised, and there is a mechanism to
> > handle the exception.
> 
> Except that this web site doesn't appear to be forbidden. I can view it just
> fine with IE6, but when I try it with urllib2, I get the same error.
> Nonetheless, I have no idea why this is happening.

Google looks at your User-Agent header.  Read their terms and
conditions and then maybe get urllib to pretend it's MSIE 6 or
whatever if you don't care about those.

If you'd looked on sf you'd have found someone reporting almost
exactly this as a bug.

Cheers,
M.

-- 
  You're posting to a Scheme group. Around here, arguing that Java is
  better than C++ is like arguing that grasshoppers taste better than
  tree bark.                        -- Thant Tessman, comp.lang.scheme



More information about the Python-list mailing list