authentication and urllib help wanted

Oleg Broytmann phd at phd.pp.ru
Thu May 30 04:02:05 EDT 2002


On Wed, May 29, 2002 at 04:02:20PM -0500, Bruce Southey wrote:
> opened_url=urllib.urlopen('http://username:password@some_site','params')
> 
> When the username/password is incorrect, urllib (actually
> FancyURLopener) requests for username and password.  I would like to
> avoid this request so to trap any incorrect username/password
> combinations.

   Write your own URLOpener, using FancyURLOpener, or just URLOpener as a
base class, and handle errors yourself.

Oleg.
-- 
     Oleg Broytmann            http://phd.pp.ru/            phd at phd.pp.ru
           Programmers don't die, they just GOSUB without RETURN.





More information about the Python-list mailing list