Fix an issue with manifest parser when "new_from_archive" API is used

This commit is contained in:
Ivan Kravets
2020-07-09 21:53:46 +03:00
parent e570aadd72
commit a688edbdf1

View File

@ -122,7 +122,9 @@ class ManifestParserFactory(object):
with tarfile.open(path, mode="r:gz") as tf:
for t in sorted(ManifestFileType.items().values()):
try:
return ManifestParserFactory.new(tf.extractfile(t).read(), t)
return ManifestParserFactory.new(
tf.extractfile(t).read().decode(), t
)
except KeyError:
pass
raise UnknownManifestError("Unknown manifest file type in %s archive" % path)