This seems to be encoding problem, indeed. The \xFE
is part of BOM(\xFE \xFF
) for UTF-16 encodings.
Using UTF-16 as Python source code is not a good idea. You're not able to give Python parser a hint of the source code encoding of the source file using the encoding mark. Such as
# encoding: utf-8
See PEP-0263
for detailed explanation, and below is part of important information:
Any encoding which allows processing the first two lines in the way indicated above is allowed as source code encoding, this includes ASCII compatible encodings as well as certain multi-byte encodings such as Shift_JIS. It does not include encodings which use two or more bytes for all characters like e.g. UTF-16. The reason for this is to keep the encoding detection algorithm in the tokenizer simple.