diff --git a/sos/cleaner/archives/__init__.py b/sos/cleaner/archives/__init__.py index 70e168d8b9..61b741a24a 100644 --- a/sos/cleaner/archives/__init__.py +++ b/sos/cleaner/archives/__init__.py @@ -25,6 +25,9 @@ def extract_archive(archive_path, tmpdir): archive = tarfile.open(archive_path) path = os.path.join(tmpdir, 'cleaner') + # set extract data filter since python 3.12 (see PEP-706 for more) + archive.extraction_filter = getattr(tarfile, 'data_filter', + (lambda member, path: member)) archive.extractall(path) archive.close() return os.path.join(path, archive.name.split('/')[-1].split('.tar')[0])