From c3e745ec35e2f3dce73e3864539452b5a1589724 Mon Sep 17 00:00:00 2001 From: Tanner Collin Date: Sun, 23 Jan 2022 02:04:12 +0000 Subject: [PATCH] Catch UnicodeDecodeError --- main.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/main.py b/main.py index 34d2b99..c2ee554 100644 --- a/main.py +++ b/main.py @@ -77,7 +77,11 @@ def reader_thread(card_data_queue): card = ser.readline() if not card: continue - card = card.decode().strip() + try: + card = card.decode().strip() + except UnicodeDecodeError: + continue + if len(card) != 10: continue # debounce card scans