From 16d18fbf98dee51d0c13521664ec404c0f41f758 Mon Sep 17 00:00:00 2001 From: rickD Date: Fri, 28 Jul 2017 13:20:52 -0700 Subject: [PATCH] handle byte literal in parseN --- dbfread/field_parser.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/dbfread/field_parser.py b/dbfread/field_parser.py index e54ccb2..52e8528 100644 --- a/dbfread/field_parser.py +++ b/dbfread/field_parser.py @@ -169,6 +169,8 @@ def parseN(self, field, data): except ValueError: if not data.strip(): return None + elif isinstance(data, (bytes, bytearray)): + return int.from_bytes(data, byteorder='big', signed=True) else: # Account for , in numeric fields return float(data.replace(b',', b'.'))