Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions src/installer/records.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,7 @@ def to_row(self, path_prefix: str | None = None) -> tuple[str, str, str]:
path = self.path

# Convert Windows paths to use / for consistency
if os.sep == "\\":
path = path.replace("\\", "/") # pragma: no cover
path = path.replace("\\", "/")

return (
path,
Expand Down
5 changes: 5 additions & 0 deletions tests/test_records.py
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,11 @@ def test_string_representation_with_prefix(
)
assert record.to_row("prefix/") == expected_row

def test_to_row_normalizes_windows_path_on_any_platform(self):
record = RecordEntry.from_elements(r"package\module.py", "", "")

assert record.to_row() == ("package/module.py", "", "")

def test_equality(self):
record = RecordEntry.from_elements(
"file.py",
Expand Down
Loading