Repository navigation
🐛 fix(seed): scope pip RECORD rewrites - #3677
Merged
Merged
Conversation
gaborbernat
force-pushed
the
fix/7zn-pip-record
branch
3 times, most recently
from
November 20, 2026 09:16
d80d3fa to
094b009
Compare
The pip seeder scanned installed metadata after pip ran, including stale distributions left in a reused environment. A stale RECORD row could direct the launcher update to another package's RECORD outside the environment. Read the top-level RECORD name from each selected wheel, then update that installed metadata file. Nested vendored RECORD files remain outside this selection. Fixes pypa#3625
The wheel source can disappear during installation if its cache is reset. Read the RECORD names while detaching metadata from the wheels, before pip installs their staged copies.
Validate wheel members before looking up RECORD so invalid entry and script names still report their specific errors. A wheel without RECORD now raises a clear error instead of StopIteration.
gaborbernat
force-pushed
the
fix/7zn-pip-record
branch
from
November 20, 2026 10:46
094b009 to
509a4fe
Compare
gaborbernat
marked this pull request as ready for review
November 20, 2026 12:16
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PipInvoke._rewrite_launcherssearched every installed distribution after the pip seeder ran. In a reused environment, stale metadata for a seed package could supply aRECORDpath outside that environment. The rewrite now uses the metadata path in each selected wheel. Fixes #3625.Stale metadata supplied the output path
The seeder invokes pip with
--ignore-installed, which overwrites installed packages. The old distribution scan still found stale metadata in the reused destination. It selected the first row ending in.dist-info/RECORD, resolved that row as a path, and wrote there even when the row belonged to another distribution. Before running pip, the new selection takes a top-levelRECORDname from each selected wheel; after installation, it reads that file under the environment's site-packages roots. The existing header rewrite and checksum calculation run for rows in that file.Behavior changes
Reseeding with
--seeder pipno longer rewrites stale distributions under other metadata paths or uses their rows to write outside the environment. Launcher rewrites andRECORDupdates apply to metadata paths named by the wheels selected for this seed run.Reported by oss-scanner: ANT-2026-7ZNZMO8Q.