Catch UnicodeDecodeError
This commit is contained in:
parent
51c21a10b5
commit
c3e745ec35
6
main.py
6
main.py
|
@ -77,7 +77,11 @@ def reader_thread(card_data_queue):
|
||||||
card = ser.readline()
|
card = ser.readline()
|
||||||
if not card: continue
|
if not card: continue
|
||||||
|
|
||||||
card = card.decode().strip()
|
try:
|
||||||
|
card = card.decode().strip()
|
||||||
|
except UnicodeDecodeError:
|
||||||
|
continue
|
||||||
|
|
||||||
if len(card) != 10: continue
|
if len(card) != 10: continue
|
||||||
|
|
||||||
# debounce card scans
|
# debounce card scans
|
||||||
|
|
Loading…
Reference in New Issue
Block a user