report at bugs
May 15, 2012, 1:54 AM
Post #5 of 10
Glenn Linderman <v+python [at] g> added the comment:
[issue14811] compile fails - UTF-8 character decoding
[In reply to]
There is no traceback. Here is the text of the Syntax error.
d:\my\im\infiles>c:\python32\python.exe d:\my\py\t33a.py -h
File "d:\my\py\t33a.py", line 2
SyntaxError: Non-UTF-8 code starting with '\xc3' in file d:\my\py\t33a.py on line 3, but no encoding declared; see http://python.org/dev/peps/pep-0263/ for details
My understanding is Python 3 uses utf-8 as the default encoding for source files -- unless there is an encoding line; and I've set my emacs to save all .py files as utf-8-unix (meaning with no CR, if you aren't an emacs user).
I verified with a hex dump that the encoding in the file is UTF-8, but you are welcome to also, that is the file I uploaded.
So your testing would seem to indicate it is a platform specific bug. Try running it on Windows, then.
Further, if it were the platform default encoding, adding a space wouldn't cure it... the encoding of the file would still be UTF-8, and the platform default encoding would still be the same whatever you think it might be (but I think it is UTF-8 for source text), so adding a space would not effect an encoding mismatch.
Python tracker <report [at] bugs>
Python-bugs-list mailing list