summaryrefslogtreecommitdiffstats
path: root/Lib/test
diff options
context:
space:
mode:
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>2020-11-25 10:01:01 (GMT)
committerGitHub <noreply@github.com>2020-11-25 10:01:01 (GMT)
commitbda2e68c8849e23899b3dad9e436c06303254943 (patch)
tree44c7b8e47fc149faed7ae7fd9a87446e402e9205 /Lib/test
parent8388a333070e3a0022b0fc4ce1ac876a2805c0a0 (diff)
downloadcpython-bda2e68c8849e23899b3dad9e436c06303254943.zip
cpython-bda2e68c8849e23899b3dad9e436c06303254943.tar.gz
cpython-bda2e68c8849e23899b3dad9e436c06303254943.tar.bz2
bpo-12800: tarfile: Restore fix from 011525ee9 (GH-21409)
Restore fix from 011525ee92eb1c13ad1a62d28725a840e28f8160. (cherry picked from commit 4fedd7123eaf147edd55eabbbd72e0bcc8368e47) Co-authored-by: Julien Palard <julien@palard.fr>
Diffstat (limited to 'Lib/test')
-rw-r--r--Lib/test/test_tarfile.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/Lib/test/test_tarfile.py b/Lib/test/test_tarfile.py
index be717e3..bee00c5 100644
--- a/Lib/test/test_tarfile.py
+++ b/Lib/test/test_tarfile.py
@@ -1314,10 +1314,10 @@ class WriteTest(WriteTestBase, unittest.TestCase):
f.write('something\n')
os.symlink(source_file, target_file)
with tarfile.open(temparchive, 'w') as tar:
- tar.add(source_file)
- tar.add(target_file)
+ tar.add(source_file, arcname="source")
+ tar.add(target_file, arcname="symlink")
# Let's extract it to the location which contains the symlink
- with tarfile.open(temparchive) as tar:
+ with tarfile.open(temparchive, errorlevel=2) as tar:
# this should not raise OSError: [Errno 17] File exists
try:
tar.extractall(path=tempdir)