diff -r 75b5617b8dfc Lib/test/test_ntpath.py --- a/Lib/test/test_ntpath.py Sun Oct 12 13:29:15 2014 +0200 +++ b/Lib/test/test_ntpath.py Sun Oct 12 18:20:27 2014 +0300 @@ -306,13 +306,14 @@ class TestNtpath(unittest.TestCase): self.skipTest('nt module not available') def test_relpath(self): - currentdir = os.path.split(os.getcwd())[-1] tester('ntpath.relpath("a")', 'a') tester('ntpath.relpath(os.path.abspath("a"))', 'a') tester('ntpath.relpath("a/b")', 'a\\b') tester('ntpath.relpath("../a/b")', '..\\a\\b') - tester('ntpath.relpath("a", "../b")', '..\\'+currentdir+'\\a') - tester('ntpath.relpath("a/b", "../c")', '..\\'+currentdir+'\\a\\b') + with support.temp_cwd(support.TESTFN) as cwd_dir: + currentdir = os.path.basename(cwd_dir) + tester('ntpath.relpath("a", "../b")', '..\\'+currentdir+'\\a') + tester('ntpath.relpath("a/b", "../c")', '..\\'+currentdir+'\\a\\b') tester('ntpath.relpath("a", "b/c")', '..\\..\\a') tester('ntpath.relpath("c:/foo/bar/bat", "c:/x/y")', '..\\..\\foo\\bar\\bat') tester('ntpath.relpath("//conky/mountpoint/a", "//conky/mountpoint/b/c")', '..\\..\\a') diff -r 75b5617b8dfc Lib/test/test_urllib2.py --- a/Lib/test/test_urllib2.py Sun Oct 12 13:29:15 2014 +0200 +++ b/Lib/test/test_urllib2.py Sun Oct 12 18:20:27 2014 +0300 @@ -44,7 +44,7 @@ class TrivialTests(unittest.TestCase): self.assertRaises(ValueError, urllib.request.urlopen, 'bogus url') # XXX Name hacking to get this to work on Windows. - fname = os.path.abspath(urllib.request.__file__).replace('\\', '/') + fname = os.path.abspath(urllib.request.__file__).replace(os.sep, '/') if os.name == 'nt': file_url = "file:///%s" % fname