From 47e78579d4c9fe2221739b06b38b91c2e4e8c902 Mon Sep 17 00:00:00 2001 From: Jakob Ketterl Date: Fri, 27 Aug 2021 18:31:10 +0200 Subject: [PATCH] handle unparseable utf meta data --- owrx/meta.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/owrx/meta.py b/owrx/meta.py index 63eb727..d747e28 100644 --- a/owrx/meta.py +++ b/owrx/meta.py @@ -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(";")