htaccess & urllib

Rene Pijlman reply.in.the.newsgroup at my.address.is.invalid
Wed Jul 23 11:55:38 EDT 2003


Max Khesin:
>Is there a way to access an htaccess-protected directory with urllib,
>password being known?

.htaccess is not a protection mechanism, but a configuration
file. If this configuration file specifies HTTP Basic
Authentication you can use:

"class FancyURLopener(...) 
basic HTTP authentication is performed ...
Note: When performing basic authentication, a FancyURLopener
instance calls its prompt_user_passwd() method. The default
implementation asks the users for the required information on
the controlling terminal. A subclass may override this method to
support more appropriate behavior if needed."
http://www.python.org/doc/current/lib/module-urllib.html

-- 
René Pijlman




More information about the Python-list mailing list