fix(pypi): handle absolute file URLs in wheel downloader#3935
Conversation
There was a problem hiding this comment.
Code Review
This pull request updates the _strip_empty_path_segments function in urllib.bzl to correctly handle and preserve the triple slash in file:/// URLs, and adds corresponding test cases. The review feedback highlights two important issues: first, a new test case incorrectly expects the function to resolve relative path segments (..), which it does not do; second, the scheme comparison should be case-insensitive (scheme.lower() == "file") to comply with RFC 3986.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
rickeylev
left a comment
There was a problem hiding this comment.
ai review comments look legit
This fixes the normalization function to return correctly normalized file URLs which is the minimum that we need to get absolute file URLs handled correctly. We also handle envsubst. Related #3312
c07e24a to
0d270c0
Compare
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Summary: - Upgrade rules_python to the latest - Switch to bazel-in-bazel integration tests instead of the wheel extraction in build phase. - Switch to sphinxdocs - Switch to latest skylib Currently includes a patch in bazel-contrib/rules_python#3935
This fixes the normalization function to return correctly normalized
file URLs which is the minimum that we need to get absolute file
URLs handled correctly.
Related #3312