Commit 06eae678 authored by Jason R. Coombs's avatar Jason R. Coombs

Merge pull request #537 from ri0t/patch-1

This helps finding packages with bad utf
parents 6d2022eb c7873d38
......@@ -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:
metadata = f.read()
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