File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed
Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change 44import requests
55import re
66import shutil
7- from urllib .parse import quote_plus
7+ from urllib .parse import quote_plus , quote
88from create_mermaid import walk_directory
99from 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
You can’t perform that action at this time.
0 commit comments