Python specification error in Ascii file

I have a strange, annoying problem with Python 2.6. I am trying to run this file (and another) on my Embedded Linux ARM board. http://svn.tuxisalive.com/software_suite_v3/smart-core/smart-server/trunk/TDSService.py

I get this error:

File "tuxhttpserver.py", line 1 Syntax: encoding problem: with BOM

I know that the error is related to specification bytes, etc., but there are no BOM bytes, this is a simple Ascii. I checked with Hexeditor, and the linux File command pointed it to Ascii.

Im worried here ... The code worked fine on my Sheevaplug (also based on an ARM system).

+4
source share
1 answer

Do not go in cycles in the remark "with BOM". It probably doesn't matter. Usually this error means that the Python you are trying to run does not support the encoding you declare. Note:

% head -1 tmp.py # -*- coding: asdfasdfasdf -*- % python tmp.py File "tmp.py", line 1 SyntaxError: encoding problem: with BOM 

The Python installation that you use on this ARM Embedded Linux board probably lacks the "latin-1" encoding. Since you do not have non-ASCII characters in the source file, simply declare the encoding as "ascii" or do not use the encoding at all.

+10
source

Source: https://habr.com/ru/post/1308233/


All Articles