Normalize RECORD paths when writing - #349
Open
ahmojo wants to merge 1 commit into
Open
Conversation
ahmojo
marked this pull request as ready for review
July 5, 2026 02:29
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.
Summary
Fixes RECORD writing so Windows-style separators are normalized to forward slashes regardless of the platform doing the write.
What changed
RecordEntry.to_row()to normalize the output path withPureWindowsPath(...).as_posix().Why
RecordEntry.to_row()previously only replaced backslashes whenos.sep == \. That meant aRecordEntrycontaining a Windows-style path could still write backslashes when serialized on another platform. RECORD paths should use/consistently.Tests
python -m pytest tests/test_records.py::TestRecordEntry::test_string_representation_normalizes_backslash_path -qpython -m pytest tests/test_records.py -qpython -m ruff check src\installer\records.py tests\test_records.pypython -m ruff format --check src\installer\records.py tests\test_records.pypython -m nox -s test-3.14python -m pre_commit run --files src\installer\records.py tests\test_records.pyCloses #158