diff options
author | Alfred Wingate <parona@protonmail.com> | 2023-11-27 12:58:11 +0200 |
---|---|---|
committer | Arthur Zamarin <arthurzam@gentoo.org> | 2023-12-08 19:52:22 +0200 |
commit | 8edda4238ef614dfd848ff0e05167ccf1e8892f3 (patch) | |
tree | a231cecb7c20125e8ffd50b55dc7691b4f7d80c9 /src | |
parent | UnusedInherits: add whitelist for weak usage by another eclass (diff) | |
download | pkgcheck-8edda4238ef614dfd848ff0e05167ccf1e8892f3.tar.gz pkgcheck-8edda4238ef614dfd848ff0e05167ccf1e8892f3.tar.bz2 pkgcheck-8edda4238ef614dfd848ff0e05167ccf1e8892f3.zip |
checks.git: Set tarfile filter
* Not setting it triggers a DeprecationWarning in python3.12.
* Despite tarballs by git-archive being trusted, there isn't benefit in
trusting it as the tarballs don't use metadata that would require it.
Signed-off-by: Alfred Wingate <parona@protonmail.com>
Closes: https://github.com/pkgcore/pkgcheck/pull/638
Signed-off-by: Arthur Zamarin <arthurzam@gentoo.org>
Diffstat (limited to 'src')
-rw-r--r-- | src/pkgcheck/checks/git.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/pkgcheck/checks/git.py b/src/pkgcheck/checks/git.py index 525bf693..31f1dc69 100644 --- a/src/pkgcheck/checks/git.py +++ b/src/pkgcheck/checks/git.py @@ -283,6 +283,10 @@ class _RemovalRepo(UnconfiguredTree): 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) |