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 gregory.p.smith
Recipients chin, gregory.p.smith, r.david.murray
Date 2009-04-07.17:09:52
SpamBayes Score 5.711941e-08
Marked as misclassified No
Message-id <1239124195.03.0.835458779528.issue5714@psf.upfronthosting.co.za>
In-reply-to
Content
urlparse.urljoin and urlparse.urlsplit do not do what is required for 
this function.  urljoin does not collapse paths.  urlsplit has nothing 
to do with paths.

I agree r.david.murray that it is odd that it does two functions at once 
(the collapse and the split).  I wrote it specifically for its current 
use case when checking paths to cgi scripts.

The unittests for it describe the exact behavior it needs to implement.  
Trying to implement a separate collapse function is approximately the 
same amount of code because the edge cases such as
'/a/b/' and '/a/b/c/..' which both need to result in it returning 
('/a/b', '') instead of ('/a', 'b') are why it made sense to keep as a 
single function for its current use.

Unittests for the function already exist in Lib/test/test_httpservers.py  
to describe its full behavior.
History
Date User Action Args
2009-04-07 17:09:55gregory.p.smithsetrecipients: + gregory.p.smith, r.david.murray, chin
2009-04-07 17:09:55gregory.p.smithsetmessageid: <1239124195.03.0.835458779528.issue5714@psf.upfronthosting.co.za>
2009-04-07 17:09:53gregory.p.smithlinkissue5714 messages
2009-04-07 17:09:52gregory.p.smithcreate