Skip to content

Commit

Permalink
Avoid assuming RECORD file is in platlib (#2091)
Browse files Browse the repository at this point in the history
## Summary

This was a missed find-and-replace. We shouldn't assume `layout.platlib`
here, since `RECORD` will be written to `site_packages` (which could be
`layout.purelib`).

This is hard to reproduce. You need a _fresh_ environment where
`purelib` and `platlib` differ (which isn't the case for virtualenvs, at
least typically), and you need to be installing a new package that is a
purelib. I tested it by manually changing `platlib` to point to a
different path.

Closes #2064.
  • Loading branch information
charliermarsh authored Feb 29, 2024
1 parent 5e35134 commit 6c23cff
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions crates/install-wheel-rs/src/linker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -125,11 +125,7 @@ pub fn install_wheel(
let mut record_writer = csv::WriterBuilder::new()
.has_headers(false)
.escape(b'"')
.from_path(
layout
.platlib
.join(format!("{dist_info_prefix}.dist-info/RECORD")),
)?;
.from_path(site_packages.join(format!("{dist_info_prefix}.dist-info/RECORD")))?;
record.sort();
for entry in record {
record_writer.serialize(entry)?;
Expand Down

0 comments on commit 6c23cff

Please sign in to comment.