[Python-Dev] urllib2 doesn't grok URLs w/ user/passwd

Skip Montanaro skip at pobox.com
Tue Dec 30 10:03:55 EST 2003

SF seems to be down for some unscheduled reason.  Posting here just so I
don't completely forget about it should I exit my web browser before SF is
back up...

urllib2.urlopen("http://foo@www.python.org/") fails (at least in part)
because it fails to separate the username and password from the hostname.
Trying to open http://foo:bar@www.python.org/ reveals other shortcomings in
its url parsing.  It seems to me the syntactic bits shouldn't be difficult
to resolve using urllib.spluituser().  I'm much less clear what to do with
the username and password once they've been separated from the hostname.


More information about the Python-Dev mailing list