From ad735f93e084818a82b5236f9f42411f549338f3 Mon Sep 17 00:00:00 2001 From: allegroai <> Date: Tue, 18 Jan 2022 20:34:45 +0200 Subject: [PATCH] Fix StorageManager.download_folder() fails on Windows path --- clearml/storage/manager.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/clearml/storage/manager.py b/clearml/storage/manager.py index b1c48888..71a7d183 100644 --- a/clearml/storage/manager.py +++ b/clearml/storage/manager.py @@ -291,10 +291,15 @@ def download_folder( with ThreadPool() as pool: for path in helper.list(prefix=remote_url): - remote_path = os.path.join(helper.base_url, path) + remote_path = str(Path(helper.base_url) / Path(path)) \ + if helper.get_driver_direct_access(helper.base_url) else \ + "{}/{}".format(helper.base_url.rstrip('/'), path.lstrip('/')) if match_wildcard and not fnmatch.fnmatch(remote_path, match_wildcard): continue - local_url = os.path.join(local_folder, remote_path[len(remote_url):].lstrip(os.path.sep)) + local_url = os.path.join( + str(Path(local_folder)), + str(Path(remote_path[len(remote_url):].lstrip(os.path.sep))) + ) if not os.path.exists(local_url) or os.path.getsize(local_url) == 0: results.append( pool.apply_async(