Skip to content

fix(pypi): handle absolute file URLs in wheel downloader#3935

Merged
aignas merged 3 commits into
mainfrom
aignas.fix.file-url-handling
Jul 18, 2026
Merged

fix(pypi): handle absolute file URLs in wheel downloader#3935
aignas merged 3 commits into
mainfrom
aignas.fix.file-url-handling

Conversation

@aignas

@aignas aignas commented Jul 18, 2026

Copy link
Copy Markdown
Collaborator

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

@aignas
aignas requested a review from rickeylev as a code owner July 18, 2026 00:20

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread tests/pypi/urllib/urllib_tests.bzl Outdated
Comment thread python/private/pypi/urllib.bzl Outdated

@rickeylev rickeylev left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
@aignas
aignas enabled auto-merge July 18, 2026 01:14
@aignas
aignas added this pull request to the merge queue Jul 18, 2026
Merged via the queue into main with commit d0f0f35 Jul 18, 2026
10 checks passed
@aignas
aignas deleted the aignas.fix.file-url-handling branch July 18, 2026 01:46
aignas added a commit to aignas/pytest-bazel that referenced this pull request Jul 18, 2026
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants