mirror of
https://github.com/clearml/clearml
synced 2025-02-02 01:54:23 +00:00
Fix StorageManager.get_local_copy()
returning None
for a valid path in Windows
This commit is contained in:
parent
0c0739379b
commit
6330c879f8
@ -51,6 +51,10 @@ class CacheManager(object):
|
|||||||
):
|
):
|
||||||
# type: (str, bool, bool) -> Optional[str]
|
# type: (str, bool, bool) -> Optional[str]
|
||||||
helper = StorageHelper.get(remote_url)
|
helper = StorageHelper.get(remote_url)
|
||||||
|
|
||||||
|
if helper.base_url == "file://":
|
||||||
|
remote_url = os.path.expanduser(remote_url)
|
||||||
|
|
||||||
if not helper:
|
if not helper:
|
||||||
raise ValueError("Storage access failed: {}".format(remote_url))
|
raise ValueError("Storage access failed: {}".format(remote_url))
|
||||||
# check if we need to cache the file
|
# check if we need to cache the file
|
||||||
|
@ -5,6 +5,7 @@ import getpass
|
|||||||
import itertools
|
import itertools
|
||||||
import json
|
import json
|
||||||
import os
|
import os
|
||||||
|
import platform
|
||||||
import shutil
|
import shutil
|
||||||
import sys
|
import sys
|
||||||
import threading
|
import threading
|
||||||
@ -906,6 +907,8 @@ class StorageHelper(object):
|
|||||||
folder_uri = str(Path(folder_uri).absolute())
|
folder_uri = str(Path(folder_uri).absolute())
|
||||||
if folder_uri.startswith('/'):
|
if folder_uri.startswith('/'):
|
||||||
folder_uri = _base_url + folder_uri
|
folder_uri = _base_url + folder_uri
|
||||||
|
elif platform.system() == "Windows":
|
||||||
|
folder_uri = ''.join((_base_url, folder_uri))
|
||||||
else:
|
else:
|
||||||
folder_uri = '/'.join((_base_url, folder_uri))
|
folder_uri = '/'.join((_base_url, folder_uri))
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user