[Distutils] normpath/abspath problem

Greg Ward gward@python.net
Thu, 3 Aug 2000 21:47:12 -0400


Hi all --

Corran Webster has discovered an annoying little problem:
'os.path.normpath()' is broken under Mac OS.  (More precisely,
'macpath.normpath()' is broken.)

He has an alternate version which sounds agreeable to the MacPython
folks, so there's a good chance it'll be in Python 2.0, and possibly
1.6.  To maintain full compatibility with 1.5.2, though, we'd have to
include it in the Distutils and use it if necessary, eg.

    def mac_normpath (path):
        ...

    if mac and python < 1.6:
        normpath = mac_normpath
    else:
        normpath = os.path.normpath

OK, that works.  We have to search out all uses of os.path.normpath and
change them to util.normpath (where util = distutils/util.py, where the
above code would live), but that's not a big deal.  It's certainly the
clean way to do it.

But then what about abspath(), which uses normpath()?  macpath.abspath()
-- like the other two abspath() implementations -- calls normpath(), but
it would end up calling the version in macpath.py, which will still be
broken.

Options:

  * change the above code to
    if mac and python < 1.6:
        os.path.normpath = mac_normpath
    which was actually my original suggestion, but I changed my
    mind because it's *evil*

  * provide a Distutils version of abspath(), which (surprise) would be
    identical source to macpath.abspath()... but would of course refer
    to our normpath()

  * forget about Mac OS support under Python 1.5.2

I'm not really keen on any of these.  Other ideas?

...Distutils, the alternative Python test suite...

        Greg
-- 
Greg Ward - nerd                                        gward@python.net
http://starship.python.net/~gward/
God made machine language; all the rest is the work of man.