urlparse incomplete ?
maxm
maxm at mxm.dk
Thu Oct 31 06:41:27 EST 2002
I am writing code where I need to convert relative urls to absolute
urls. For this I use the urlparse module.
First of, urlparse doesn't take care of urls where there is a user and
password. Shouldn't that be corrected?
Also I have seen absolute urls of the form "//www.wired.com/path". The
ambiguity here being caused by the "//" instead of "http://".
The rfc is weak in describing if this is a legal url, but the browser
handles them well and just sets the default scheme to http. So I have to
handle it.
Naturally urlparse cannot know that the scheme is http, but if this is
indeed a legal url, shouldn't it be possible to set the default scheme
when calling urlparse?
regards Max M
More information about the Python-list
mailing list