-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unicode Decode Errror on windows #11
Comments
nilshoffmann
added a commit
that referenced
this issue
Jul 15, 2022
Fix and PR are in progress #12 |
This issue is solved, thank you for your help! Could you release it onto PyPi? |
I have installed PyGoslin 2.0.2 using pip install pygoslin and this bug is still present. I am running Anaconda and Python 3.9.7. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
On windows I have the following stacktrace when initializing Goslin (sorry for the formatting, it didnt manage to paste it and keep the new lines any other way):
Traceback (most recent call last):
File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
File "<frozen importlib._bootstrap>", line 972, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed
File "C:\Users\Konstantin\Programmierung\lipid-librarian\src\lipid_librarian\__init__.py", line 38, in <module>
goslin_converter = goslin_init()
File "C:\Users\Konstantin\Programmierung\lipid-librarian\src\lipid_librarian\__init__.py", line 27, in goslin_init
return LipidParser()
File "C:\Users\Konstantin\Programmierung\lipid-librarian\venv\lib\site-packages\pygoslin\parser\Parser.py", line 114, in __init__
self.parser_list = [ShorthandParser(), GoslinParser(), FattyAcidParser(), LipidMapsParser(), SwissLipidsParser(), HmdbParser()]
File "C:\Users\Konstantin\Programmierung\lipid-librarian\venv\lib\site-packages\pygoslin\parser\Parser.py", line 79, in __init__
super().__init__(self.event_handler, file_name, Parser.DEFAULT_QUOTE)
File "C:\Users\Konstantin\Programmierung\lipid-librarian\venv\lib\site-packages\pygoslin\parser\ParserCommon.py", line 132, in __init__
rules = Parser.extract_text_based_rules(grammar_filename, self.quote)
File "C:\Users\Konstantin\Programmierung\lipid-librarian\venv\lib\site-packages\pygoslin\parser\ParserCommon.py", line 297, in extract_text_based_rules
grammar = infile.read() + "\n";
File "C:\Users\Konstantin\AppData\Local\Programs\Python\Python39\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 0x90 in position 9820: character maps to <undefined>
I think that can be fixed by editing this line (and all other lines which read files) and specifying the encoding to UTF-8 like here
pygoslin/pygoslin/parser/ParserCommon.py
Line 296 in 01c580c
The text was updated successfully, but these errors were encountered: