theopolisme / voice2json

Export your Google Voice call & text history as JSON
MIT License
12 stars 3 forks source link

UnicodeDecodeError #2

Closed dthrash closed 6 years ago

dthrash commented 6 years ago

Using python 3.6 and beautiful soup 4.6 I received an error message. No encoding is specified when opening each file, so I fixed this by replacing line 126 with the line below. " with open(path, encoding="Latin-1") as f:"

The error message : "Traceback (most recent call last): File "voice2json.py", line 157, in main() File "voice2json.py", line 151, in main json = serialize_files_to_json(files) File "voice2json.py", line 128, in serialize_files_to_json serialized = serialize_text_messages_to_record(f.read()) File "C:\Users\Database\AppData\Local\Programs\Python\Python36-32\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 0x8d in position 1554: character maps to

theopolisme commented 6 years ago

Thanks for the report! Fixed using the io module so this continues to work in Python 2.x as well as 3.x.

Cheers, Theo