[Python-Dev] Re: os.path.commonprefix breakage (original) (raw)

M.-A. Lemburg mal@lemburg.com
Fri, 18 Aug 2000 10:05:30 +0200


Greg Ewing wrote:

> Note that the trailing slash is added by all tab-completing shells that I > know. This is for the convenience of the user, who is probably going to type another pathname component, and also to indicate that the object found is a directory. It makes sense in an interactive tool, but not necessarily in other places.

Oh, C'mon Greg... haven't you read my reply to this ?

The trailing slash contains important information which might otherwise not be regainable or only using explicit queries to the storage system.

The "/" tells the program that the last path component is a directory. Removing the slash will also remove that information from the path (and yes: files without extension are legal).

Now, since e.g. posixpath is also used as basis for fiddling with URLs and other tools using Unix style paths, removing the slash will result in problems... just look at what your browser does when you request http://www.python.org/search ... the server redirects you to search/ to make sure that the links embedded in the page are relative to search/ and not www.python.org/.

Skip, have you already undone that change in CVS ?

-- Marc-Andre Lemburg


Business: http://www.lemburg.com/ Python Pages: http://www.lemburg.com/python/