From 5b5d081bd520ec0cf49f10ebaa52dfc582e5214f Mon Sep 17 00:00:00 2001 From: Julian Berman Date: Wed, 30 Nov 2022 10:11:47 -0500 Subject: [PATCH] Fix twine( check) with the newly released pkginfo 1.9. (#941) It (the pkginfo release) removes `distribution.must_decode`, though that function was questionably public as it was an "exposed" compatibility function (removed as part of pkginfo dropping 2.7 support). See https://bazaar.launchpad.net/~tseaver/pkginfo/trunk/revision/205 --- twine/wheel.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/twine/wheel.py b/twine/wheel.py index 109de97b..cf90eab7 100644 --- a/twine/wheel.py +++ b/twine/wheel.py @@ -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")) msg = distribution.parse(fp) self.description = msg.get_payload()