[Python-Dev] A wart which should have been repaired in 3.0?

Phillip J. Eby pje at telecommunity.com
Tue Dec 30 13:33:36 CET 2008


At 06:14 AM 12/30/2008 -0600, skip at pobox.com wrote:

>Paul demonstrates the shortcoming of commonprefix:
>
>     >>> os.path.commonprefix(["foo\\bar\\baz", "foo/bar/boink"])
>     'foo'
>
>With the patch in issue4755:
>
>     >>> import ntpath
>     >>> ntpath.commonpathprefix(["foo\\bar\\baz", "foo/bar/boink"])
>     'foo\\bar'

But it doesn't handle the fact that Windows paths are 
case-insensitive, or that Posix paths can have symlinks...  or that 
one path might be relative and another absolute...

As soon as you move away from being a string operation, you get an 
endless series of gotchas...  none of which are currently documented.



More information about the Python-Dev mailing list