encoding - Python BOM error in Ascii file -
i have weird, annoying problem python 2.6. i'm trying run file (and other), on embedded linux arm board. http://svn.tuxisalive.com/software_suite_v3/smart-core/smart-server/trunk/tdsservice.py
i error:
file "tuxhttpserver.py", line 1 syntaxerror: encoding problem: bom
i know error bom bytes etc etc. but, there no bom bytes, it's plain ascii. checked hexeditor, , linux file command says ascii.
im freaking out here... code worked fine on sheevaplug (also arm based system).
don't hung on "with bom" remark. it's not relevant. error means python trying run in not support encoding declare. observe:
% head -1 tmp.py # -*- coding: asdfasdfasdf -*- % python tmp.py file "tmp.py", line 1 syntaxerror: encoding problem: bom
the python installation running on embedded linux arm board lacks 'latin-1' encoding. since don't have non-ascii characters in source file, declare encoding 'ascii', or leave out encoding altogether.
Comments
Post a Comment