From 96c0d2ab1b6d68443ad8a0b96417ad6e52200178 Mon Sep 17 00:00:00 2001 From: Israel Fruchter Date: Mon, 25 Nov 2024 10:31:36 +0200 Subject: [PATCH] scylla_repository.py: attend to python 3.12 related warnings taking care about warnings around unsafe usage of the built-in tarlib --- ccmlib/scylla_repository.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/ccmlib/scylla_repository.py b/ccmlib/scylla_repository.py index 7d92564e..b3e9d6d4 100644 --- a/ccmlib/scylla_repository.py +++ b/ccmlib/scylla_repository.py @@ -519,7 +519,11 @@ def download_version(version, url=None, verbose=False, target_dir=None, unified= if verbose: print(f"Extracting {target} ({url}, {target_dir}) as version {version} ...") tar = tarfile.open(target) - tar.extractall(path=target_dir) + if sys.version_info >= (3, 12): + kwargs = {'path': target_dir, 'filter': 'data'} + else: + kwargs = {'path': target_dir} + tar.extractall(**kwargs) tar.close() # if relocatable package format >= 2, need to extract files under subdir