From f7cee055b02d12b3766dfdbf1e038afa79922743 Mon Sep 17 00:00:00 2001 From: Adrian Imboden Date: Thu, 2 Oct 2025 08:39:59 +0000 Subject: [PATCH] allow file:// urls in experimental_index_url --- python/private/pypi/simpleapi_download.bzl | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/python/private/pypi/simpleapi_download.bzl b/python/private/pypi/simpleapi_download.bzl index 52ff02a178..1772018d48 100644 --- a/python/private/pypi/simpleapi_download.bzl +++ b/python/private/pypi/simpleapi_download.bzl @@ -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. @@ -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