Closed tmpUser2022 closed 2 years ago
setting PYTHONIOENCODING to UTF8 solves the crash/allows to stat up grammalecte-flycheck but there is still a problem detecting UTF-8 chars as UTF-8 (I don't know if the problem is from gramalecte-flycheck or gramalecte.py).
mouse over right mouse click (both are present, "é" and his translation by grammalecte as "Ã")
On windows, using an UTF-8 file, and having set pythons vars set to UTF-8 :
Adding encoding='utf8
at line around 140 of flycheck_grammalecte.py find_errors totally solves this issue.
def find_errors(input_file, opts={}):
"""Read the file and run grammalecte on it"""
with open(input_file, "r", encoding='utf8') as f:
Thank you for debugging this. I must admit I don’t have any windows under the hand to test such behavior. Do you mind open a merge request with your proposal?
Sorry being very late on that. Now that I think again about it, I wonder if it would not be better to just use a specific ascii character instead of that utf-8 one? Like the #
? I’ll make some tests with that approach.
In fact, no I won’t do that as I use other utf-8 chars to display nice arrows or non breakable spaces. So let go with your proposal.
Fixed by 5c96daa3d3ddb23a0d7576f64385ec33933eb3e5
grammalecte.py does not works by default with non ASCII UTF-8 files on Windows (because python uses the default encoding of OS).
The problem with flycheck-grammalecte is that it uses an UTF-8 char to indicate error (the char ⇨ U+21E8 RIGHTWARDS WHITE ARROW), and then, grammalecte.py crash trying to process the file.
It should probably either, force UTF-8 encoding, or remove UTF-8 chars to be multi-platform by defaults.
fix :
or in python
To reproduce the bug :
error message :