What does this bogus code in urlparse do?

Chris Mellon arkanes at gmail.com
Tue Feb 26 11:28:17 EST 2008


On Mon, Feb 25, 2008 at 11:04 PM, John Nagle <nagle at animats.com> wrote:
> See "http://svn.python.org/view/python/trunk/Lib/urlparse.py?rev=60163&view=markup"
>
>  Look at "urljoin".
>
>  What does the code marked "# XXX The stuff below is bogus in various
>  ways..." do?
>
>  I think it's an attempt to remove leading "../" components in URLs, which are
>  generally ignored.  But it also does something with commas, and it's not
>  clear why.
>
>                                 John Nagle
>  --

You should probably invest in syntax highlighting ;), it doesn't do
anything with commas (just '.', '..' , and '').  It appears to be
trying to normalize relative URLs into a single absolute one, as the
docstring implies.



More information about the Python-list mailing list