Skip to content

Commit 9f3fb78

Browse files
authored
Merge pull request #1011 from dannon/fix-test-data-encoding
fix url encoding for test files with spaces in their names
2 parents 79dea1a + ce376d3 commit 9f3fb78

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

scripts/workflow_manifest.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
import requests
55
import re
66
import shutil
7-
from urllib.parse import quote_plus
7+
from urllib.parse import quote_plus, quote
88
from create_mermaid import walk_directory
99
from planemo.galaxy.workflows import job_template
1010

@@ -230,7 +230,10 @@ def path_to_location(input_item, root):
230230
else:
231231
# Create location URL from path for downloading files
232232
relative_path = os.path.join(root.replace("./", ""), input_item["path"].lstrip("/"))
233-
input_item["location"] = f"https://raw.githubusercontent.com/galaxyproject/iwc/main/{relative_path}"
233+
# URL-encode the path to handle spaces and special characters
234+
# Use safe='/' to keep forward slashes unencoded as path separators
235+
encoded_path = quote(relative_path, safe='/')
236+
input_item["location"] = f"https://raw.githubusercontent.com/galaxyproject/iwc/main/{encoded_path}"
234237
del input_item["path"]
235238
if "filetype" not in input_item:
236239
# Add filetype if not present

0 commit comments

Comments
 (0)