Skip to content

Commit add177b

Browse files
committed
wip
Signed-off-by: Nicolas Nobelis <nicolas.nobelis@bosch.com>
1 parent faf1dcf commit add177b

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/python_inspector/package_data.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,11 @@ def canonicalize_url(url: str):
9393
# os.path.normpath will handle segments like '.' and '..'
9494
canonical_path = os.path.normpath(parsed.path)
9595

96+
# On Windows, normpath uses backslashes ('\\').
97+
# We must replace them with forward slashes ('/') for a valid URL path.
98+
if os.path.sep == '\\':
99+
canonical_path = canonical_path.replace('\\', '/')
100+
96101
# Rebuild the URL with the canonicalized path
97102
# We replace the original path with the new one
98103
parsed = parsed._replace(path=canonical_path)

0 commit comments

Comments
 (0)