diff --git a/src/pkgcheck/checks/git.py b/src/pkgcheck/checks/git.py index 525bf6936..31f1dc69e 100644 --- a/src/pkgcheck/checks/git.py +++ b/src/pkgcheck/checks/git.py @@ -283,6 +283,10 @@ def _populate(self, pkgs): if old_files.poll(): error = old_files.stderr.read().decode().strip() raise PkgcheckUserException(f"failed populating archive repo: {error}") + # https://docs.python.org/3.12/library/tarfile.html#tarfile-extraction-filter + if hasattr(tarfile, "data_filter"): + # https://docs.python.org/3.12/library/tarfile.html#tarfile.TarFile.extraction_filter + tarfile.TarFile.extraction_filter = staticmethod(tarfile.data_filter) with tarfile.open(mode="r|", fileobj=old_files.stdout) as tar: tar.extractall(path=self.location)