Skip to content

Commit 13887c8

Browse files
s-t-e-v-e-n-kabravalheri
authored andcommitted
tests: Add extraction_filter for tarfile
Python 3.12, and earlier via security backports now issue an DeprecationWarning when calling tarfile.extractall without an extraction filter set. Since the only place we've called extractall is literally right after we've created the archive, use a fully trusted filter. This can be replaced with a filter argument to extractall in future.
1 parent b8c0a59 commit 13887c8

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

setuptools/tests/test_easy_install.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -697,6 +697,7 @@ def test_setup_requires_override_nspkg(self, use_setup_cfg):
697697
foobar_1_dir = os.path.join(temp_dir, 'foo.bar-0.1')
698698
os.mkdir(foobar_1_dir)
699699
with tarfile.open(foobar_1_archive) as tf:
700+
tf.extraction_filter = (lambda member, path: member)
700701
tf.extractall(foobar_1_dir)
701702
sys.path.insert(1, foobar_1_dir)
702703

0 commit comments

Comments
 (0)