[Web-SIG] urlparse method behaviour when handing abs/rel urls

Fred Drake fdrake at gmail.com
Fri Jun 27 21:16:38 CEST 2008

On Fri, Jun 27, 2008 at 3:01 PM, O.R.Senthil Kumaran
<orsenthil at gmail.com> wrote:
> BTW, commonly when someone writes 'www.python.org', we tend to understand that
> he is referring to net_loc. Is it not?
> And also, when we type 'www.python.org' at Address Location in the
> Browser, it automatically gets translated to http://www.python.org as the full
> url and www.python.org becomes net_loc in this case.

There are two cases here:

1. Relative URLs in a context that has a base URL (inside a resource
loaded from a URL, or in an (X)HTML document that includes a <base>

2. Abreviated URLs in a user interface that implies no context with a
base URL (like the browser's address bar).

I'd suggest that these are completely different.  urlsplit and
urlparse support 1.  If we want the second, that should be a separate
function.  It would be reasonable to add that to the urlparse module
(urllib.parse in Python 3).


Fred L. Drake, Jr. <fdrake at gmail.com>
"Chaos is the score upon which reality is written." --Henry Miller

More information about the Web-SIG mailing list