Newbie problem with HTTP Redirection in Python 2.4 urllib2

Michael Sparks zathras at thwackety.com
Sat Jul 10 11:24:42 EDT 2004


On 10 Jul 2004, Sriram Krishnan wrote:

> I've just downloaded the alpha of Python 2.4 ...
...
> Am I making a newbie error here? Or am I missing something?

I think so - your example works fine in python 2.3:
>>> import urllib2
>>> thing = urllib2.HTTPRedirectHandler()
>>> opener = urllib2.build_opener(thing)
>>> url = 'http://www.msdn.com'
>>> page = opener.open(url)

I think the "newbie error" is using alpha code and expecting it to work
perfectly. 2.4 has just had it's first alpha release - I'd suggest
installing python 2.3 for the moment until 2.4 has been released!

(In case you're completely new to all this, "alpha" means "new,
interesting, probably has bugs, please play with only if you know what
you're doing". It has a very different meaning from (say) "alpha male"
where "alpha" might mean many things perhaps including "best" or "top" :)

If it breaks for you using 2.3 then it's possible you have network
issues - such as needing to use a proxy, or DNS on that box isn't setup
quite right.


Michael.




More information about the Python-list mailing list