-
Notifications
You must be signed in to change notification settings - Fork 5
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
cohesion crashes when using system-dependent encoding #21
Comments
Hmm, interesting. Thanks for opening this issue and even including a fix PR. I do have one question though, could this cause issues in reverse? In other words, if we hardcode Would another solution here be to use UTF-8 mode? In other words you could run python with the |
Hi, it's possible, but since UTF-8 is the default encoding for Python code, it'd be a more sane default, instead of relying on the filesystem. |
Looking into it further, I updated the PR in the case that's satisfactory. Thanks |
Currently cohesion uses the default encoding for
open()
:cohesion/cohesion/filesystem.py
Lines 10 to 11 in b9add60
This takes the encoding from
locale.getpreferredencoding()
, which on my Windows installation is cp1252. So even though my file is saved in UTF-8, cohesion loads it in cp1252, crashing withUnicodeDecodeError: 'charmap' codec can't decode byte 0x90 in position 9011: character maps to <undefined>
Adding
encoding="utf-8"
would solve this issue.The text was updated successfully, but these errors were encountered: