handle unparseable utf meta data

This commit is contained in:
Jakob Ketterl 2021-08-27 18:31:10 +02:00
parent 54a1cae352
commit 47e78579d4

View File

@ -172,7 +172,11 @@ class MetaParser(Parser):
self.currentMetaData = None
def parse(self, raw: memoryview):
raw = raw.tobytes().decode("utf-8").rstrip("\n")
try:
raw = raw.tobytes().decode("utf-8").rstrip("\n")
except UnicodeError:
logger.warning("unable to decode meta binary: %s", str(raw.tobytes()))
return
for meta in raw.split("\n"):
fields = meta.split(";")