diff options
author | Julien Palard <julien@palard.fr> | 2020-11-25 09:23:17 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-11-25 09:23:17 (GMT) |
commit | 4fedd7123eaf147edd55eabbbd72e0bcc8368e47 (patch) | |
tree | fc8ea4cf109b749c519ad1e86defde9ee8fbbfce /Lib/test/test_tarfile.py | |
parent | c9c6e9f89aa68ce8094393a1a5575b67d26bc8c8 (diff) | |
download | cpython-4fedd7123eaf147edd55eabbbd72e0bcc8368e47.zip cpython-4fedd7123eaf147edd55eabbbd72e0bcc8368e47.tar.gz cpython-4fedd7123eaf147edd55eabbbd72e0bcc8368e47.tar.bz2 |
bpo-12800: tarfile: Restore fix from 011525ee9 (GH-21409)
Restore fix from 011525ee92eb1c13ad1a62d28725a840e28f8160.
Diffstat (limited to 'Lib/test/test_tarfile.py')
-rw-r--r-- | Lib/test/test_tarfile.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/Lib/test/test_tarfile.py b/Lib/test/test_tarfile.py index 7b34d53..77ad830 100644 --- a/Lib/test/test_tarfile.py +++ b/Lib/test/test_tarfile.py @@ -1347,10 +1347,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) |