Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion python/private/pypi/simpleapi_download.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ def _read_simpleapi(ctx, url, attr, cache, get_auth = None, **download_kwargs):
return _read_index_result(ctx, download, output, real_url, cache, cache_key)

def strip_empty_path_segments(url):
"""Removes empty path segments from a URL. Does nothing for urls with no scheme.
"""Removes empty path segments from a URL. Does nothing for urls with no scheme and file:// urls.

Public only for testing.

Expand All @@ -246,6 +246,8 @@ def strip_empty_path_segments(url):
The url with empty path segments removed and any trailing slash preserved.
If the url had no scheme it is returned unchanged.
"""
if url.startswith("file://"):
return url
scheme, _, rest = url.partition("://")
if rest == "":
return url
Expand Down