mirror of
https://github.com/python/cpython.git
synced 2025-11-01 10:45:30 +00:00
bpo-12800: tarfile: Restore fix from 011525ee9 (GH-21409)
Restore fix from 011525ee92.
This commit is contained in:
parent
c9c6e9f89a
commit
4fedd7123e
3 changed files with 10 additions and 3 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue