John Nagle wrote: > In Python, of course, "urlparse.urlparse", which is > the main function used to disassemble a URL, has no idea whether it's > being used by a client or a server, so it, reasonably enough, takes option > 1.
>>> import urlparse >>> base="http://somesite.com/level1/" >>> path="../page.html" >>> urlparse.urljoin(base,path) 'http://somesite.com/page.html' >>> base="http://somesite.com/" >>> urlparse.urljoin(base,path) 'http://somesite.com/../page.html' For me this is a bug and is very annoying because I can't simply trip ../ from path because base could have a level. -- Best regards, -- Sérgio M. B. -- http://mail.python.org/mailman/listinfo/python-list