Clean up internal fields of WheelWriter#2870
Merged
Conversation
messense
approved these changes
Nov 24, 2025
messense
added a commit
that referenced
this pull request
Feb 7, 2026
#2870 refactored `module_writer.rs`, and in doing so [removed a line](d593605#diff-a5f91562326af952084dcfb75851be91314679f06545de0c7ea8e9057ebe6ad5L55) which reformatted `PathBuf` rendered platform-specific `String`s to exclusively us `/`: ```python // The zip standard mandates using unix style paths let target = target.to_str().unwrap().replace('\\', "/"); ``` While it seems this is [technically allowed](https://packaging.python.org/en/latest/specifications/recording-installed-packages/#the-record-file), some tools choke on this. In my case, the [`wheel`](https://pypi.org/project/wheel/) package does not like windows-style paths in the `RECORD` file (even on Windows itself). I've also added a unit test to validate this - though because the implementation uses `PathBuf::to_string_lossy`, it will only actually fail on Windows. --------- Co-authored-by: messense <messense@icloud.com>
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.
This PR makes basically 3 changes:
recordfield inWheelWriterto aBTreeMapso that the records are already sorted by pathZipWriter::start_file()withZipWriter::start_file_from_path()because the latter automatically deals with zip path normalization, including replacing back slashes with forward slashesrecord_pathandwheel_pathfields from the struct becausewheel_pathcan be recovered from the underlying file after the zip is closed, andrecord_pathcan be calculated fromMetadata24if provided