Fix cross-device link in Python tests

This commit is contained in:
Justine Tunney 2022-05-13 06:50:55 -07:00
parent 77b70ba193
commit d25a67f4eb

View file

@ -152,8 +152,10 @@ class UnicodeFileTests(unittest.TestCase):
def test_rename(self):
for name in self.files:
os.rename(name, "tmp")
os.rename("tmp", name)
tmp = os.environ.get('TMPDIR', '/tmp')
pid = os.getpid()
os.rename(name, "%s/foobar.%d" % (tmp, pid))
os.rename("%s/foobar.%d" % (tmp, pid), name)
def test_directory(self):
dirname = os.path.join(support.TESTFN, 'Gr\xfc\xdf-\u66e8\u66e9\u66eb')