A strange one: a commented line throws an error

sohcahtoa82 at gmail.com sohcahtoa82 at gmail.com
Mon May 16 14:04:33 EDT 2016


On Monday, May 16, 2016 at 10:25:54 AM UTC-7, DFS wrote:
> print "test"
> # stz source pytz.timezone() instance (for naïve local datetimes)
> 
> $ python temp.py
>    File "temp.py", line 2
> SyntaxError: Non-ASCII character '\xc3' in file temp.py on line 2, but 
> no encoding declared; see http://python.org/dev/peps/pep-0263/ for details
> 
> 
> 
> 
> python 2.7.11 on Windows

Yup.  That's the error I would expect when you use non-ASCII characters in your code without declaring the character encoding as described in PEP 263, which is conveniently linked in the exception details.



More information about the Python-list mailing list