A problem with urllib

Aki Niimura akineko at pacbell.net
Sun Jun 30 15:33:07 EDT 2002


Hi,

I have noticed this problem for a while. 

Using FancyURLopener, you can provide user, passwd to authenticate a page
in your program. (You need to override prompt_user_passwd() function)

This feature works fine for most cases.

However, when I tried to read my DSL router's Status page which 
required an authentication, it failed.

The DSL router's default authentication is:
user   "" <<<-- empty string
passwd "admin"

urllib doesn't like user to be an empty string. Thus, it keeps asking
a new user, passwd input (another call to prompt_user_passwd() ).
And eventually it went crazy (recursive error?).

Although providing an empty string to user input is a rare situation,
I would like to read the DSL router's Status page to get the WAN
address. BTW, you can change the passwd but can not specify the user 
in my DSL router.

>From my Web browser, the following works just fine.
http://:admin@192.168.1.1/Status.htm

Any workaround?

Thanks in advance.

Best regards,
Aki Niimura



More information about the Python-list mailing list