From 0a59c5dd5b4177b5ad19948001c8175e4c1b1537 Mon Sep 17 00:00:00 2001 From: Benjamin Pritchard Date: Fri, 10 Nov 2023 16:35:42 -0500 Subject: [PATCH] Fix deprecated tarfile call --- basis_set_exchange/tests/test_bundle.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/basis_set_exchange/tests/test_bundle.py b/basis_set_exchange/tests/test_bundle.py index 7ee1c296..cb0361d9 100644 --- a/basis_set_exchange/tests/test_bundle.py +++ b/basis_set_exchange/tests/test_bundle.py @@ -33,6 +33,7 @@ """ import os +import sys import zipfile import tarfile import pytest @@ -50,7 +51,10 @@ def _extract_all(filepath, extract_dir): zf.extractall(extract_dir) elif filepath.endswith('.tar.bz2'): with tarfile.open(filepath, 'r:bz2') as tf: - tf.extractall(extract_dir) + if sys.version_info >= (3, 11): + tf.extractall(extract_dir, filter='fully_trusted') + else: + tf.extractall(extract_dir) else: raise RuntimeError("Unexpected file extension")