What’s the point of os.path.commonprefix?

Most of the Python standard library is great, providing functions and classes
that do their jobs well, often even before you knew you needed the job done
(urlsafe_b64encode FTW!)

Which makes my disappointment with os.path.commonprefix
all the stronger. This function is worse than useless, it’s misleading.
Although it’s in the os.path
module, it knows nothing about paths, working instead character-by-character:

Note that this may return invalid paths because it works a character at a time.

But it should say:

This function is in the wrong place, and has nothing to do with paths,
don’t use it if you are interested in file paths!

I accepted a patch to coverage.py which used this function, and it looked good.
But eventually I turned up cases it got wrong, and had to re-discover what
people seem to have
understood this for at least eight years. *Sigh*

Oddly enough, I actually needed exactly this functionality two years, and decided to look in os.path just in case. So while it may be annoying and broken to other people, for me it was "Batteries included" at just the right time.