]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Fixed tests for shutil.make_archive() with relative base_name in the case when
authorSerhiy Storchaka <storchaka@gmail.com>
Tue, 8 Sep 2015 06:59:02 +0000 (09:59 +0300)
committerSerhiy Storchaka <storchaka@gmail.com>
Tue, 8 Sep 2015 06:59:02 +0000 (09:59 +0300)
the path of the directory for temporary files contains symlinks.

Lib/test/test_shutil.py

index 5b82a2c05fae9b1580f83995e475fdaf3b6796f8..c458c45dcb71ef2e02641b8d7f5f3f94c41aa1a3 100644 (file)
@@ -382,9 +382,9 @@ class TestShutil(unittest.TestCase):
         # working with relative paths
         work_dir = os.path.dirname(tmpdir2)
         rel_base_name = os.path.join(os.path.basename(tmpdir2), 'archive')
-        base_name = os.path.join(work_dir, rel_base_name)
 
         with support.change_cwd(work_dir):
+            base_name = os.path.abspath(rel_base_name)
             tarball = make_archive(rel_base_name, 'gztar', root_dir, '.')
 
         # check if the compressed tarball was created
@@ -473,9 +473,9 @@ class TestShutil(unittest.TestCase):
         # working with relative paths
         work_dir = os.path.dirname(tmpdir2)
         rel_base_name = os.path.join(os.path.basename(tmpdir2), 'archive')
-        base_name = os.path.join(work_dir, rel_base_name)
 
         with support.change_cwd(work_dir):
+            base_name = os.path.abspath(rel_base_name)
             res = make_archive(rel_base_name, 'zip', root_dir, base_dir)
 
         self.assertEqual(res, base_name + '.zip')