-
Notifications
You must be signed in to change notification settings - Fork 2
Open
Description
Some files fail with encoding errors:
Traceback (most recent call last):
File "split_scan.py", line 50, in <module>
scanData = load_json_file(argv[1])
File "split_scan.py", line 13, in load_json_file
data = json.load(f)
File "C:\Users\pgreen.SYNOPSYS\AppData\Local\Programs\Python\Python38\lib\json\__init__.py", line 293, in load
return loads(fp.read(),
File "C:\Users\pgreen.SYNOPSYS\AppData\Local\Programs\Python\Python38\lib\encodings\cp1252.py", line 23, in decode
return codecs.charmap_decode(input,self.errors,decoding_table)[0]
UnicodeDecodeError: 'charmap' codec can't decode byte 0x81 in position 899969521: character maps to <undefined>
This can be fixed by changing load_json_file to read as UTF-8
def load_json_file(filename):
with open(filename, encoding='utf-8') as f:
data = json.load(f)
return data
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels