From 5ffc30bc76d5b59d8bab44cec41aa368ccafa6d6 Mon Sep 17 00:00:00 2001 From: Jack Smith Date: Mon, 17 Jul 2023 18:54:36 +0100 Subject: [PATCH] Update conda_lock/pypi_solver.py Co-authored-by: Ben Mares --- conda_lock/pypi_solver.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/conda_lock/pypi_solver.py b/conda_lock/pypi_solver.py index c400aeb70..e29b723f1 100644 --- a/conda_lock/pypi_solver.py +++ b/conda_lock/pypi_solver.py @@ -386,5 +386,7 @@ def _prepare_repositories_pool(allow_pypi_requests: bool) -> Pool: def _strip_auth(url: str) -> str: """Strip HTTP Basic authentication from a URL.""" parts = urlsplit(url, allow_fragments=True) - netloc = parts.netloc.replace(f"{parts.username}:{parts.password}@", "") + # Remove everything before and including the last '@' character in the part + # between 'scheme://' and the subsequent '/'. + netloc = parts.netloc.split("@")[-1] return urlunsplit((parts.scheme, netloc, parts.path, parts.query, parts.fragment))