Erick Jones added the comment:

This ended up biting me also.  I had a list of URLs to fetch with 
authentication.  One of the URLs was bad (returning 401 even with 
authentication), and that was causing all of the subsequent URLs to fail as 
well since the reset count wasn't getting reset.

I also don't like that the retry count is stored in the handler -- that's 
mutable global state, which wreaks havoc if I use this with Eventlet coroutines 
for concurrent page fetches.  (If I just add the authentication headers myself, 
then urllib2 works just fine under Eventlet.)

Couldn't the retry count be stored in the request object itself?

And why do we even need a retry "count"?  If it fails without authentication, 
then try it with authentication.  If it fails again, just return to the 
application.  It makes no sense to retry four more times.

----------
nosy: +Erick.Jones

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue9698>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to