bugfix UnicodeDecodeError: 'charmap' codec can't decode byte 0x9d in … #57
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
…position 54258: character maps to
When I try to execute the example, I get the following error message:
Traceback (most recent call last):
File "tm.py", line 5, in
tm = TM("my test tm")
File "C:\Users\thorbne\PycharmProjects\pytm\pytm\pytm.py", line 195, in init
threats_json = json.load(threat_file)
File "C:\Users\thorbne\AppData\Local\Programs\Python\Python38\lib\json_init_.py", line 293, in load
return loads(fp.read(),
File "C:\Users\thorbne\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 0x9d in position 54258: character maps to
It's because python is using a wrong enconding. I added utf-8 as encoding to be used and now the example is working fine.