Skip to content

Commit a46ee19

Browse files
author
Tatjana Damnjanović
committed
Escape path on windows in upload command
1 parent 25388b9 commit a46ee19

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

solvebio/cli/data.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,8 +151,11 @@ def _upload_folder(
151151
for abs_local_parent_path, folders, files in os.walk(base_local_path):
152152
# Strips off the local path and adds the parent directory at
153153
# each phase of the loop
154+
base_local_path_dirname = os.path.dirname(base_local_path)
155+
if os.name == "nt":
156+
base_local_path_dirname = re.escape(os.path.dirname(base_local_path))
154157
local_parent_path = re.sub(
155-
"^" + os.path.dirname(base_local_path), "", abs_local_parent_path
158+
"^" + base_local_path_dirname, "", abs_local_parent_path
156159
).lstrip("/")
157160

158161
if should_exclude(abs_local_parent_path, exclude_paths, dry_run=dry_run):

0 commit comments

Comments
 (0)