[Python-checkins] cpython (merge 3.4 -> 3.5): Fixed tests for shutil.make_archive() with relative base_name in the case when

serhiy.storchaka python-checkins at python.org
Tue Sep 8 09:01:21 CEST 2015


https://hg.python.org/cpython/rev/7f380e3a8de9
changeset:   97777:7f380e3a8de9
branch:      3.5
parent:      97773:e4a2089ad684
parent:      97775:bbf72b164720
user:        Serhiy Storchaka <storchaka at gmail.com>
date:        Tue Sep 08 10:00:22 2015 +0300
summary:
  Fixed tests for shutil.make_archive() with relative base_name in the case when
the path of the directory for temporary files contains symlinks.

files:
  Lib/test/test_shutil.py |  4 ++--
  1 files changed, 2 insertions(+), 2 deletions(-)


diff --git a/Lib/test/test_shutil.py b/Lib/test/test_shutil.py
--- a/Lib/test/test_shutil.py
+++ b/Lib/test/test_shutil.py
@@ -977,9 +977,9 @@
         # 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
@@ -1067,9 +1067,9 @@
         # 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')

-- 
Repository URL: https://hg.python.org/cpython


More information about the Python-checkins mailing list