Skip to content

Commit fad1d6e

Browse files
sdroegeeli-schwartz
authored andcommitted
Wrap tarfile.fully_trusted_filter in staticmethod for wrap file handling too
That's how it is done in the other two places and without that one argument too many is passed to the filter function: ``` [...] File "/usr/lib/python3.14/site-packages/mesonbuild/wrap/wrap.py", line 607, in _get_file shutil.unpack_archive(path, extract_dir) ~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^ File "/usr/lib64/python3.14/shutil.py", line 1432, in unpack_archive func(filename, extract_dir, **kwargs) ~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib64/python3.14/shutil.py", line 1349, in _unpack_tarfile tarobj.extractall(extract_dir, filter=filter) ~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib64/python3.14/tarfile.py", line 2409, in extractall tarinfo, unfiltered = self._get_extract_tarinfo( ~~~~~~~~~~~~~~~~~~~~~~~~~^ member, filter_function, path) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib64/python3.14/tarfile.py", line 2496, in _get_extract_tarinfo filtered = filter_function(unfiltered, path) TypeError: fully_trusted_filter() takes 2 positional arguments but 3 were given ```
1 parent df4c35b commit fad1d6e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

mesonbuild/wrap/wrap.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@
5959

6060
if sys.version_info >= (3, 14):
6161
import tarfile
62-
tarfile.TarFile.extraction_filter = tarfile.fully_trusted_filter
62+
tarfile.TarFile.extraction_filter = staticmethod(tarfile.fully_trusted_filter)
6363

6464
if mesonlib.is_windows():
6565
from ..programs import ExternalProgram

0 commit comments

Comments
 (0)