From 27400d67dc358cda8610a61b01966cf4ee2679e1 Mon Sep 17 00:00:00 2001 From: Mohammad Kassem Date: Sun, 8 Dec 2024 21:31:55 +0000 Subject: [PATCH] Fix utils test error (revert a change) --- cli/medperf/utils.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/cli/medperf/utils.py b/cli/medperf/utils.py index 0b013d236..b6e95a5db 100644 --- a/cli/medperf/utils.py +++ b/cli/medperf/utils.py @@ -191,8 +191,9 @@ def untar(filepath: str, remove: bool = True) -> str: logging.info(f"Uncompressing tar.gz at {filepath}") addpath = str(Path(filepath).parent) try: - with tarfile.open(filepath) as tar: - tar.extractall(addpath) + tar = tarfile.open(filepath) + tar.extractall(addpath) + tar.close() except tarfile.ReadError as e: raise ExecutionError("Cannot extract tar.gz file, " + e.__str__())