[issue4755] Common path prefix

2010-07-25 Thread Craig McQueen
Craig McQueen added the comment: http://code.activestate.com/recipes/577016-path-entire-split-commonprefix/ -- nosy: +cmcqueen1975 ___ Python tracker ___

[issue4755] Common path prefix

2008-12-30 Thread Nick Coghlan
Nick Coghlan added the comment: The regex based approach to the component splitting when os.altsep is defined obviously works as well. Duplicating the values of sep and altsep in the default regex that way grates a little though... ___ Python tracker

[issue4755] Common path prefix

2008-12-30 Thread Nick Coghlan
Nick Coghlan added the comment: 1. The discussion on python-dev shows that the current documentation of os.path.commonprefix is incorrect - it technically works element by element rather than character by character (since it will handle sequences other than strings, such as lists of path compone

[issue4755] Common path prefix

2008-12-30 Thread Skip Montanaro
Skip Montanaro added the comment: I think we need to recognize the inherent limitations of what we can expect to do. It is perfectly reasonable for a user on Windows to import posixpath and call posixpath.commonpathprefix. The function won't have access to the actual filesystems being manipula

[issue4755] Common path prefix

2008-12-30 Thread Martin v. Löwis
Martin v. Löwis added the comment: The documentation should explain what a "common path prefix" is. It can't be the path to a common parent directory, since the new function doesn't allow mixing absolute and relative directories. As Phillip Eby points out, it also doesn't account for case-insens

[issue4755] Common path prefix

2008-12-29 Thread Jeff Hall
Changes by Jeff Hall : -- nosy: +laxrulz777 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.o

[issue4755] Common path prefix

2008-12-26 Thread Nick Coghlan
Nick Coghlan added the comment: A new function sounds like a good solution to me. How about just calling it "os.path.commonpath" though? I agree having a path component based prefix function in os.path is highly desirable, particularly since the addition of relpath in 2.6: base_dir = os.path.c

[issue4755] Common path prefix

2008-12-26 Thread Skip Montanaro
New submission from Skip Montanaro : os.path.commonprefix returns the common prefix of a list of paths taken character-by-character. This can return invalid paths. For example, os.path.commonprefix(["/export/home/dave", "/etc/passwd"]) will return "/e", which likely has no meaning as a path,