diff -urN a/Lib/distutils/command/install.py b/Lib/distutils/command/install.py --- a/Lib/distutils/command/install.py 2013-06-26 22:19:35.487603398 +0100 +++ b/Lib/distutils/command/install.py 2013-06-26 22:24:15.000000000 +0100 @@ -348,7 +348,8 @@ # Convert directories from Unix /-separated syntax to the local # convention. - self.convert_paths('lib', 'purelib', 'platlib', + self.convert_paths('base', 'platbase', + 'lib', 'purelib', 'platlib', 'scripts', 'data', 'headers', 'userbase', 'usersite') diff -urN a/Lib/distutils/util.py b/Lib/distutils/util.py --- a/Lib/distutils/util.py 2013-06-26 22:19:35.484270065 +0100 +++ b/Lib/distutils/util.py 2013-06-26 22:25:38.000000000 +0100 @@ -130,6 +130,13 @@ paths.remove('.') if not paths: return os.curdir + # On Windows, if paths is ['C:','folder','subfolder'] then + # os.path.join(*paths) will return 'C:folder\subfolder' which + # is thus relative to the CWD on that drive. So we work around + # this by adding a \ to path[0] + if (len(paths) > 0 and paths[0].endswith(':') and + sys.platform == "win32" and sys.version.find("GCC") >= 0): + paths[0] += '\\' return os.path.join(*paths) # convert_path () @@ -140,6 +147,10 @@ relative, this is equivalent to "os.path.join(new_root,pathname)". Otherwise, it requires making 'pathname' relative and then joining the two, which is tricky on DOS/Windows and Mac OS. + + If on Windows or OS/2 and both new_root and pathname are on different + drives, raises DistutilsChangeRootError as this is nonsensical, + otherwise use drive which can be in either of new_root or pathname. """ if os.name == 'posix': if not os.path.isabs(pathname): @@ -147,17 +158,20 @@ else: return os.path.join(new_root, pathname[1:]) - elif os.name == 'nt': - (drive, path) = os.path.splitdrive(pathname) - if path[0] == '\\': - path = path[1:] - return os.path.join(new_root, path) - - elif os.name == 'os2': + elif os.name == 'nt' or os.name == 'os2': (drive, path) = os.path.splitdrive(pathname) - if path[0] == os.sep: - path = path[1:] - return os.path.join(new_root, path) + if path[0] == os.sep: + path = path[1:] + (drive_r, path_r) = os.path.splitdrive(new_root) + drive_used = '' + if len(drive) == 2 and len(drive_r) == 2 and drive != drive_r: + raise DistutilsChangeRootError, \ + "root and pathname not on same drive (%s, %s)" % (drive,drive_r) + elif len(drive_r) == 2: + drive_used = drive_r+os.sep + else: + drive_used = drive+os.sep + return os.path.join(drive_used+path_r, path) else: raise DistutilsPlatformError, \ diff -urN a/Makefile.pre.in b/Makefile.pre.in --- a/Makefile.pre.in 2013-06-26 22:19:35.517603398 +0100 +++ b/Makefile.pre.in 2013-06-26 22:20:01.047603789 +0100 @@ -1147,7 +1147,7 @@ --prefix=$(prefix) \ --install-scripts=$(BINDIR) \ --install-platlib=$(DESTSHARED) \ - --root=$(DESTDIR)/ + --root=$(DESTDIR) -rm $(DESTDIR)$(DESTSHARED)/_sysconfigdata.py* # Here are a couple of targets for MacOSX again, to install a full