Skip to content
Merged
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
2 changes: 1 addition & 1 deletion twine/wheel.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,6 @@ def read_file(name: str) -> bytes:
def parse(self, data: bytes) -> None:
super().parse(data)

fp = io.StringIO(distribution.must_decode(data))
fp = io.StringIO(data.decode("utf-8", errors="replace"))
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Given the original function here seems to have been used mostly for 2.X sake, I went with just calling decode, and since the original function fell back to latin-1, I went with errors=replace. But I'm not sure the latter case can actually happen in real life (i.e. whether it'd be against the wheel spec anyhow)?

msg = distribution.parse(fp)
self.description = msg.get_payload()