Commit c7873d38 authored by riot's avatar riot

This helps finding packages with bad utf

Checking hundreds of possibly installed packages manually should NOT be expected of the user ;)
parent a31716f5
......@@ -1859,7 +1859,10 @@ class FileMetadata(EmptyProvider):
def get_metadata(self, name):
if name=='PKG-INFO':
with io.open(self.path, encoding='utf-8') as f:
try:
metadata = f.read()
except UnicodeDecodeError as e:
raise Exception("Bad utf in package: %s - %s" % (self.path, e))
return metadata
raise KeyError("No metadata except PKG-INFO is available")
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment