got some trouble with a simple Python script. I’m sure that there are a few Python experts here. When I execute my script with Xojo then everything is okay. After building with Py2App I get an error message when executing: “Syntax error: non utf-8 starting with ‘\0xca’ in file xxx on line 1, but no encoding declared.”
Does anyone have an idea what Python 3.4.x wants to tell me? I’ve had a look at the source code file with 0xED and there is no character ca in the file. Let alone in the first line.
got some trouble with a simple Python script. I’m sure that there are a few Python experts here. When I execute my script with Xojo then everything is okay. After building with Py2App I get an error message when executing: “Syntax error: non utf-8 starting with ‘\0xca’ in file xxx on line 1, but no encoding declared.”
Does anyone have an idea what Python 3.4.x wants to tell me? I’ve had a look at the source code file with 0xED and there is no character ca in the file. Let alone in the first line.[/quote]
Dump the file in a hex editor and you’ll probably find the offending byte. This often happens to me when I paste in text that turns out to contain smart quotes, unicode hyphens, and the link.
Reverted back to a version that should work: no difference.
It must be something on my machine, because an older version of the Python app crashes (fatal error something) on my main dev machine. The app works just fine on my laptop. For now I’ve cheated and copied the py file to the app that worked.