From 8e97631933961302ccae19c6e0385b5dbe983193 Mon Sep 17 00:00:00 2001 From: shrlnm Date: Thu, 11 May 2023 09:48:53 +0300 Subject: [PATCH] fix for reading empty vin When VIN is empty, it contains 0x00 or 0xFF which can't be converted to ascii by decode function. --- ecu.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ecu.py b/ecu.py index 8b529d32..a1f38c39 100644 --- a/ecu.py +++ b/ecu.py @@ -664,7 +664,7 @@ def getDisplayValue(self, elm_data, dataitem, ecu_endian): return None if self.bytesascii: - return bytes.fromhex(value).decode('utf-8') + return bytes.fromhex(value).decode('utf-8',errors="ignore") # I think we want Hex format for non scaled values if not self.scaled: