reddit-save icon indicating copy to clipboard operation
reddit-save copied to clipboard

UnicodeDecodeError: 'charmap' codec can't decode byte

Open PAK90 opened this issue 2 years ago • 2 comments

Trying to run the script (py save.py upvoted target/folder) on Win10, python 3.10, getting this error:

Traceback (most recent call last):
  File "C:\Users\user\Documents\reddit-save\save.py", line 46, in <module>
    current_html = f.read()
  File "C:\Users\user\AppData\Local\Programs\Python\Python310\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 0x8f in position 12990: character maps to <undefined>

It's odd, because it worked fine the last time I tried running this script. Tried pip install again, no difference. I do have multiple logindata files, but only one's named logindata.py so I don't think that's the issue (and it was running fine a week or so ago with the multiple logindata files in the directory).

PAK90 avatar Sep 29 '22 02:09 PAK90

I think it just needs UTF-8 specified explicitly - does the newest version resolve the issue?

samirelanduk avatar Oct 01 '22 00:10 samirelanduk

Yeah seems to have done; thanks for the quick fix!

PAK90 avatar Oct 01 '22 01:10 PAK90