diff -Naur Python-3.4.3.orig/Lib/distutils/tests/test_util.py Python-3.4.3/Lib/distutils/tests/test_util.py --- Python-3.4.3.orig/Lib/distutils/tests/test_util.py 2015-02-25 11:27:44.000000000 +0000 +++ Python-3.4.3/Lib/distutils/tests/test_util.py 2015-05-29 10:29:16.152123848 +0000 @@ -208,6 +208,8 @@ return '/'.join(path) os.path.join = _join + self.assertEqual(change_root('/root', '//old/its/here'), + '/root/old/its/here') self.assertEqual(change_root('/root', '/old/its/here'), '/root/old/its/here') self.assertEqual(change_root('/root', 'its/here'), diff -Naur Python-3.4.3.orig/Lib/distutils/util.py Python-3.4.3/Lib/distutils/util.py --- Python-3.4.3.orig/Lib/distutils/util.py 2015-02-25 11:27:44.000000000 +0000 +++ Python-3.4.3/Lib/distutils/util.py 2015-05-29 10:31:44.199114154 +0000 @@ -140,20 +140,11 @@ """Return 'pathname' with 'new_root' prepended. If 'pathname' is 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. + two. """ - if os.name == 'posix': - if not os.path.isabs(pathname): - return os.path.join(new_root, pathname) - else: - return os.path.join(new_root, pathname[1:]) - - elif os.name == 'nt': + if os.name in ['posix', 'nt', 'os2']: (drive, path) = os.path.splitdrive(pathname) - if path[0] == '\\': - path = path[1:] - return os.path.join(new_root, path) - + return os.path.join(new_root, path.lstrip(os.sep)) else: raise DistutilsPlatformError("nothing known about platform '%s'" % os.name)