From e8236572b8270e06222cc605432bc8284a902408 Mon Sep 17 00:00:00 2001 From: Alex Martani Date: Wed, 11 Dec 2024 11:43:21 -0800 Subject: [PATCH] fix: Strip trailing slash for repo url (#2495) Strip potential trailing slash when building url on the case of relative path without up-references. In particular, this fixes using `experimental_index_url` with a AWS CodeArtifact python repository, which currently fails package downloads due to an incorrect URL (with double `//`) being produced by this code. Co-authored-by: Richard Levasseur --- python/private/pypi/parse_simpleapi_html.bzl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python/private/pypi/parse_simpleapi_html.bzl b/python/private/pypi/parse_simpleapi_html.bzl index b4e7dd8330..e549e76181 100644 --- a/python/private/pypi/parse_simpleapi_html.bzl +++ b/python/private/pypi/parse_simpleapi_html.bzl @@ -138,4 +138,4 @@ def _absolute_url(index_url, candidate): return "{}/{}".format(index_url, last.strip("/")) # relative path without up-references - return "{}/{}".format(index_url, candidate) + return "{}/{}".format(index_url.rstrip("/"), candidate)