http error 301 for urlopen

Nobody nobody at nowhere.com
Sun Nov 7 21:41:29 EST 2010


On Sun, 07 Nov 2010 20:51:50 -0500, D'Arcy J.M. Cain wrote:

>> urllib2.HTTPError: HTTP Error 301: The HTTP server returned a redirect error
>> that would lead to an infinite loop.
>> The last 30x error message was:
>> Moved Permanently
>> 
>> I can open the link in browser. Any way to get solve this? Thanks.
> 
> I checked with my tools and was told that it redirects more than five
> times.  Maybe it's not infinite but too many for urlopen.

The default value of urllib2.HTTPRedirectHandler.max_redirections is 10.
Setting it to 11 allows the request to complete.





More information about the Python-list mailing list