From a528fd8f66fb4428968244f14cfdeb3b0dfa5462 Mon Sep 17 00:00:00 2001 From: Francisco Vila Date: Fri, 3 Oct 2025 15:59:50 +0200 Subject: [PATCH] fix consumer decode when the message is encrypted Signed-off-by: Francisco Vila --- Consumer.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Consumer.py b/Consumer.py index 4dd72f6..342a97f 100644 --- a/Consumer.py +++ b/Consumer.py @@ -15,7 +15,10 @@ def get_value_from_type(obj): value_str = obj if isinstance(obj, bytes): - value_str = obj.decode("utf-8") + try: + value_str = obj.decode("utf-8") + except UnicodeDecodeError: + value_str = "".join(map(chr, obj)) if isinstance(obj, list): value_str = [get_value_from_type(x) for x in obj] if isinstance(obj, tuple):