clearml icon indicating copy to clipboard operation
clearml copied to clipboard

Cannot use relative path for local folder with contents having same exact same name as folder in Storagemanager.upload_folder()

Open janesenaj42 opened this issue 2 years ago • 2 comments

Line 246 args=(str(path), str(path).replace(local_folder, remote_url)) in this file doesn't support usage of relative path for local folder with contents having exact same name as folder.

This example will fail:

folder_name = 'dummy'
os.mkdir(os.path.join('.', folder_name))
with open(os.path.join(folder_name, folder_name, '.txt'), 'w') as file:
   file.write('asdfasdf')
Storagemanager.upload_folder(folder_name, <S3_PATH>)

No issue using full path for local folder with contents that have the same name as the folder, but this wasn't noted down in the docs.

janesenaj42 avatar Aug 16 '22 02:08 janesenaj42

Hi @janesenaj Are you saying that we should do local_folder = Path(local_folder).absolute().as_posix() here ?

bmartinn avatar Aug 19 '22 22:08 bmartinn

Hi @janesenaj Are you saying that we should do local_folder = Path(local_folder).absolute().as_posix() here ?

I think this solution would work, as long as the absolute path is replaced by the s3 url in here.

janesenaj42 avatar Aug 29 '22 02:08 janesenaj42