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

O.R.Senthil Kumaran orsenthil at gmail.com
Fri Jun 27 21:01:08 CEST 2008


* scriptor Ian Bicking explico:

> > At http://bugs.python.org/issue754016, there is a discussion wherein if a 
> > URL
> > is given in a normal way to urlparse (For e.g. urlparse('www.python.org')), 
> > it
> > parses it as a path rather than as the net_loc component as is the comman 
> > case
> > with browsers.
> 
>  Browsers interpret it as a path, e.g., <a 
>  href="www.python.org">python.org</a> will not take you to www.python.org
> 

Yes, you are right. In that case, what urlparse is currently doing is same as
what browser does. :) Surprise and I had forgot this! :)

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. 

Should we consider this scenario?

Thanks,
Senthil

-- 
O.R.Senthil Kumaran
http://uthcode.sarovar.org


More information about the Web-SIG mailing list