Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix twine( check) with the newly released pkginfo 1.9. #941

Merged
merged 1 commit into from Nov 30, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion twine/wheel.py
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
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()