https://sentry.io/quodlibet/quodlibet/issues/425434407/
UnicodeDecodeError: 'charmap' codec can't decode byte 0x8d in position 328: character maps to <undefined>
File "quodlibet/qltk/songsmenu.py", line 156, in __on_activate
self.__handle(item, plugin, library, songs, parent)
File "quodlibet/qltk/songsmenu.py", line 216, in __handle
if any(ret):
File "quodlibet/ext/songsmenu/importexport.py", line 153, in plugin_album
for line in open(fn, 'rU'):
File "cp1252.py", line 23, in decode
UnicodeDecodeError: 'charmap' codec can't decode byte 0x8d in position 328: character maps to <undefined>
I guess I forgot to review the open() calls :/
You have to find the correct encoding. Common ones are Latin-1 and UTF-8. and you have to specify the encoding when you open the file:
exemple :
file = open(filename, encoding="utf8")
Thanks! I was completely lost... this helps!
Please help me out from this error in python 3.7.9
2020-08-28:21:46:43,143 INFO [iwn.py:43] Loading hindi language synsets...
Traceback (most recent call last):
File "D:\Ph D\WSD\Review Paper Outline RRC and Paper-III Seminar\Progress Report\Progress Report-III\New folder\1.py", line 13, in
iwn=pyiwn.IndoWordNet(lang=pyiwn.Language.HINDI)
File "C:\Python\lib\site-packages\pyiwn\iwn.py", line 45, in __init__
self._synset_df = self._load_synset_file(lang.value)
File "C:\Python\lib\site-packages\pyiwn\iwn.py", line 51, in _load_synset_file
synsets = list(map(lambda line: self._load_synset(line), f.readlines()))
File "C:\Python\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 13: character maps to
Most helpful comment
You have to find the correct encoding. Common ones are Latin-1 and UTF-8. and you have to specify the encoding when you open the file:
exemple :
file = open(filename, encoding="utf8")