From d6363bd452fd6e5045c28a718a6c7ec6c28d3edc Mon Sep 17 00:00:00 2001 From: huweiqiang Date: Mon, 25 Sep 2023 15:57:40 +0800 Subject: [PATCH] bugfix(init_samples): fix path error on Windows platform --- deepdataspace/services/config.py | 1 - deepdataspace/services/dds.py | 4 ++-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/deepdataspace/services/config.py b/deepdataspace/services/config.py index 406ec49..8fc36fc 100644 --- a/deepdataspace/services/config.py +++ b/deepdataspace/services/config.py @@ -9,7 +9,6 @@ import requests -from deepdataspace.utils.function import retry from deepdataspace.utils.os import PLATFORM from deepdataspace.utils.os import Platforms from deepdataspace.utils.string import gen_random_str diff --git a/deepdataspace/services/dds.py b/deepdataspace/services/dds.py index 0c18327..31de6ea 100644 --- a/deepdataspace/services/dds.py +++ b/deepdataspace/services/dds.py @@ -138,7 +138,7 @@ def prefight_checks(self): self.exit_or_raise(msg) def init_samples(self): - sample_file = f"/{self.runtime_dir}/dataset-samples.zip" + sample_file = os.path.join(self.runtime_dir, "dataset-samples.zip") if not os.path.exists(sample_file): sample_url = f"{self.dl_prefix}/datasets/dataset-samples.zip" @@ -146,7 +146,7 @@ def init_samples(self): download_by_requests(sample_url, sample_file) with zipfile.ZipFile(sample_file, "r") as fp: - fp.extractall(f"{self.runtime_dir}/") + fp.extractall(f"{self.runtime_dir}") extract_dir = f"{self.runtime_dir}/dataset-samples" for item in os.listdir(extract_dir):