urllib2 Basic authentication, what am I doing wrong?

Max Erickson maxerickson at gmail.com
Sun Apr 13 16:00:27 EDT 2008


On Apr 13, 2:11 pm, Michel Bouwmans <mfb.chikaz... at gmail.com> wrote:

> Using this nice class (adapted to urllib2) as a basehandler I see that no
> Authentication-header is being send out:http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/440574
>
> What am I doing wrong here? I spend almost my entire free time today on this
> and couldn't find any problem with my code, anyone else has a thought?
> Thanks in advance.
>
> MFB

I've attempted to use a password manager and auth manager and failed
in the past, so this is only a guess, but presumably, between the
realm and uri that you are providing to the password manager, it isn't
providing a password for the page you want to load. I've had success
just explicitly setting the authorization header, using the method
discussed in the comments on this page:

http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/267197


max



More information about the Python-list mailing list