From 984560ed5b3de7500dcb4f89b7fa845e5affa07a Mon Sep 17 00:00:00 2001 From: Marat Fayzullin Date: Mon, 18 Sep 2023 17:25:41 -0400 Subject: [PATCH] Made parsing text decoder output more reliable. --- owrx/dsp.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/owrx/dsp.py b/owrx/dsp.py index 5317bdcb..af7299fc 100644 --- a/owrx/dsp.py +++ b/owrx/dsp.py @@ -760,7 +760,7 @@ class DspManager(SdrSourceEventClient, ClientDemodulatorSecondaryDspEventClient) # If we know it's not pickled, let us not unpickle if len(b) < 2 or b[0] != 0x80 or not 3 <= b[1] <= pickle.HIGHEST_PROTOCOL: try: - callback(b.decode("ascii")) + callback(b.decode("ascii", errors="replace")) except Exception as e: logger.debug("Unpickler: %s" % e) return @@ -772,9 +772,7 @@ class DspManager(SdrSourceEventClient, ClientDemodulatorSecondaryDspEventClient) except EOFError: pass except pickle.UnpicklingError: - callback(b.decode("ascii")) - except ValueError: - pass + callback(b.decode("ascii", errors="replace")) return unpickler