diff --git a/examples/python/arkitscenes/download_dataset.py b/examples/python/arkitscenes/download_dataset.py index d2f5e2cbe62a..cc2e59d2cc5d 100644 --- a/examples/python/arkitscenes/download_dataset.py +++ b/examples/python/arkitscenes/download_dataset.py @@ -3,6 +3,7 @@ import math import os import subprocess +import zipfile from pathlib import Path from typing import Final, List, Optional @@ -121,9 +122,9 @@ def download_file(url: str, file_name: str, dst: Path) -> bool: def unzip_file(file_name: str, dst: Path, keep_zip: bool = True) -> bool: filepath = os.path.join(dst, file_name) print(f"Unzipping zip file {filepath}") - command = f"unzip -oq {filepath} -d {dst}" try: - subprocess.check_call(command, shell=True) + with zipfile.ZipFile(filepath, "r") as zip_ref: + zip_ref.extractall(dst) except Exception as error: print(f"Error unzipping {filepath}, error: {error}") return False