[Python-bugs-list] [Bug #112288] os.path.commonprefix behaviour change.

noreply@sourceforge.net noreply@sourceforge.net
Fri, 18 Aug 2000 20:09:32 -0700


Bug #112288, was updated on 2000-Aug-19 12:48
Here is a current snapshot of the bug.

Project: Python
Category: Library
Status: Open
Resolution: None
Bug Group: None
Priority: 6
Summary: os.path.commonprefix behaviour change.

Details: From python-dev:

On 1.5.2, the behaviour was:
>>> os.path.commonprefix(["../foo/bar", "../foo/spam"])
'../foo/'

While since the change we have:
'../foo'

Note that the trailing slash has been dropped.

[snip existing code that was broken by this change - much debate on python-dev ensues about which is the more desirable behaviour.]

Tim adds:
I agree this is Bad Damage, and should be fixed before 2.0b1 goes out.  Can you enter a bug report?

[more debate about what is the better behaviour, and that the old way was obviously broken]

Tim again:
commonprefix worked exactly as documented for at least 6 years and 5 months (which is when CVS shows Guido checking in ntpath.py with the character-based functionality), and got out of synch with the docs about 5 weeks ago when Skip changed to this other algorithm.  Since the docs *did* match the code, there's no reason to believe the original
author was confused, and no reason to believe users aren't relying on it (they've had over 6 years to gripe <wink>).

And Tim yet again:
When the code and the docs have matched for more than 6 years, there is no bug by any rational definition of the term, and you can be certain that changing the library semantics then will break existing code.  Presuming to change it anyway is developer arrogance of the worst kind, no matter how many developers cheer it on.  The docs are a
contract, and if they were telling the truth, we have a responsibility to stand by them


For detailed info, follow this link:
http://sourceforge.net/bugs/?func=detailbug&bug_id=112288&group_id=5470