Open GoogleCodeExporter opened 9 years ago
This is some great work, thanks for investigating what's going on! While
revamping the unit tests I kept a close eye on the test coverage, and I've
known that several areas -- including the auth code -- desperately needed to be
tested.
I'll work to get this fixed as soon as I have time.
Original comment by kurtmckee
on 13 Jun 2011 at 12:43
The problem appears to be in _FeedURLHandler, and more specifically its
inheritance from urllib2.HTTPDigestAuthHandler. HTTPDigestAuthHandler has a
handler_order of 490, which gives it precedence over
urllib2.HTTPBasicAuthHandler. Given that _FeedURLHandler is designed to always
come last (well, second to last, as HTTPErrorProcessor has a handler order of
1000) and remove any HTTPError exceptions, this isn't a great idea.
The attached patch just manually sets the default value to 500, which fixes the
issue in my case (but may break the Auth Digest handling).
Original comment by t.dettr...@uq.edu.au
on 10 Jan 2012 at 2:11
Attachments:
As a workaround for this issue, you can simply raise the priority of your
HTTPBasicAuthHandler to 490:
>>> handler = urllib2.HTTPBasicAuthHandler(passman)
>>> handler.handler_order = 490
This will give it an opportunity to handle the error before _FeedURLHandler.
Original comment by t.dettr...@uq.edu.au
on 10 Jan 2012 at 2:15
Thanks for the patch, I'll review it as soon as I have an opportunity!
Original comment by kurtmckee
on 10 Jan 2012 at 8:02
By the way, the workaround `handler.handler_order = 490` worked great for me;
we're fixed in production now.
Original comment by tra...@gmail.com
on 20 Nov 2012 at 11:09
Original issue reported on code.google.com by
tra...@gmail.com
on 7 Jun 2011 at 11:39