Reputation: 115
I'm maintinaing a library of python code. All bar one of the modules in the library runs through pylint with no problems.
For this one module pylint returns error F0010.
<some_module>.py:1: [F0010(parse-error), ] error while code parsing: Wrong or no encoding specified for <some_module>.py
I've stared at the code for hours and I can't see quite what's so special about it. There is nothing that jumps out at me as being different in any substantial way to the other modules in the library. File names, headers, footers are all very similar, PEP8 etc etc.
Does anyone have any hints for debugging this error?
If nothing else I'd like to have a pylint score for it so I can justify its existence in its current form, and I really don't want to rewrite it from scratch to appease pylint.
Upvotes: 1
Views: 1143
Reputation: 115
Turns out I've managed to fix the problem.
Whoever edited it last saved it as ANSI rather than UTF-8.
Thanks for the pointers, as its not somethign I would have thought of checking. I found this out when I was looking to see what it was actually encoded as, in response to the comments above. I'd have assumed it was UTF-8 as all the other files in the library are UTF-8, in fact everything here is utf-8, apart from this one file...
Now to up its pylint score a bit.
Upvotes: 1