-
Notifications
You must be signed in to change notification settings - Fork 8
UnicodeDecodeError: 'charmap' codec can't decode byte 0x81 in position 2772: character maps to <undefined> #28
Copy link
Copy link
Open
Description
Dear developers,
We were working in December with the libChEBIpy library without any problems, however this year our scripts keep crashing. We are running the code on iMacs (MacOS Ventura, Big Sur and Catalina; running Python 3.8, 3.9, 3.10 and 3.11), with the same error message in all cases.
You can easily reproduce the error with a 2-line code, which produces the error message below (note that no modifications to the code have been made since December). Can you give us any advice on what to do to fix this new issue?
Test code:
import libchebipy
c=libchebipy.ChebiEntity("29108")
Generates the error:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/anaconda3/lib/python3.8/site-packages/libchebipy/_chebi_entity.py", line 30, in __init__
if self.get_name() is None:
File "/usr/local/anaconda3/lib/python3.8/site-packages/libchebipy/_chebi_entity.py", line 93, in get_name
name = parsers.get_name(self.__chebi_id)
File "/usr/local/anaconda3/lib/python3.8/site-packages/libchebipy/_parsers.py", line 242, in get_name
__parse_compounds()
File "/usr/local/anaconda3/lib/python3.8/site-packages/libchebipy/_parsers.py", line 294, in __parse_compounds
for line in textfile:
File "/usr/local/anaconda3/lib/python3.8/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 2772: character maps to <undefined>
Many thanks in advance!!
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels