[Python-Dev] Re: os.path.commonprefix breakage
Guido van Rossum
guido@python.org
Fri, 18 Aug 2000 15:13:14 -0400
I'm reading this tread off-line. I'm feeling responsible because I gave Skip
the green light. I admit that that was a mistake: I didn't recall the
purpose of commonprefix() correctrly, and didn't refresh my memory by
reading the docs. I think Tim is right: as the docs say, the function was
*intended* to work on a character basis. This doesn't mean that it doesn't
belong in os.path! Note that os.dirname() will reliably return the common
directory, exactly because the trailing slash is kept.
I propose:
- restore the old behavior on all platforms
- add to the docs that to get the common directory you use dirname()
- add testcases that check that this works on all platforms
- don't add commonpathprefix(), because dirname() already does it
Note that I've only read email up to Thursday morning. If this has been
superseded by more recent resolution, I'll reconsider; but if it's still up
in the air this should be it.
It doesn't look like the change made it into 1.6.
--Guido