summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2015-09-08 06:59:02 (GMT)
committerSerhiy Storchaka <storchaka@gmail.com>2015-09-08 06:59:02 (GMT)
commit672237e8874adb7b6ea591d183c9e12a5a75d622 (patch)
treec56f72fc02447f12c5e9c93eed313c691beacea1
parentbc071655e8fc4d8331bd31abdeb631e1ac8b910a (diff)
downloadcpython-672237e8874adb7b6ea591d183c9e12a5a75d622.zip
cpython-672237e8874adb7b6ea591d183c9e12a5a75d622.tar.gz
cpython-672237e8874adb7b6ea591d183c9e12a5a75d622.tar.bz2
Fixed tests for shutil.make_archive() with relative base_name in the case when
the path of the directory for temporary files contains symlinks.
-rw-r--r--Lib/test/test_shutil.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/Lib/test/test_shutil.py b/Lib/test/test_shutil.py
index 5b82a2c..c458c45 100644
--- a/Lib/test/test_shutil.py
+++ b/Lib/test/test_shutil.py
@@ -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')