This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author orsenthil
Recipients monk.e.boy, orsenthil
Date 2008-05-16.03:48:34
SpamBayes Score 0.17401889
Marked as misclassified No
Message-id <1210909720.18.0.718159575959.issue2583@psf.upfronthosting.co.za>
In-reply-to
Content
Just try it this way.
>>> print urlparse.urljoin('http://site.com/', 'path/../path/.././path/./')
http://site.com/path/
>>>

The difference is the inital '/' in the second argument.
Human interpretation is:
Go to http://site.com/ and 1) go to path directory 2) go to one-level
above (/../) which results in site.com again 3) go to path directory 4)
go to one-level above (..) (results site.com )5) Stay in the same
directory (.) 6) goto path 7) stay there (.) 
Final result is http://www.site.com/path/

When you start the path with a '/'
>>> print urlparse.urljoin('http://site.com/', '/path/../path/.././path/./')
http://site.com/path/../path/.././path/./

The RFC (1808) suggests the following.
urlparse.urljoin('http://a/b/c/d','/./g') = <URL:http://a/./g>
The argument is taken as a complete path for the server.


The way to use this would be, this way:

>>> print urlparse.urljoin('http://site.com/', 'path/../path/.././path/./')
http://site.com/path/
>>>

This is not a bug and can be closed.
History
Date User Action Args
2008-05-16 03:48:41orsenthilsetspambayes_score: 0.174019 -> 0.17401889
recipients: + orsenthil, monk.e.boy
2008-05-16 03:48:40orsenthilsetspambayes_score: 0.174019 -> 0.174019
messageid: <1210909720.18.0.718159575959.issue2583@psf.upfronthosting.co.za>
2008-05-16 03:48:38orsenthillinkissue2583 messages
2008-05-16 03:48:37orsenthilcreate