[New-bugs-announce] [issue1495] Unicode in a comment.
report at bugs.python.org
Sat Nov 24 22:00:40 CET 2007
New submission from Magnus Valle:
My script reports this problem:
$ python bug.py
File "bug.py", line 4
SyntaxError: Non-ASCII character '\xc2' in file bug.py on line 4, but no
encoding declared; see http://www.python.org/peps/pep-0263.html for details
This error looks fine and all, but the problem is that the non-ASCII
character (in this case '¤') is in a comment, not in the script itself.
If I remove it the non-ASCII character from the comment, it runs perfectly.
I always assumed that comment didn't effect the script.
This isn't exactly a big problem, but I don't think it should be this way.
I included the demo script.
$ python -V
title: Unicode in a comment.
versions: Python 2.5
Added file: http://bugs.python.org/file8803/bug.py
Tracker <report at bugs.python.org>
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 93 bytes
Desc: not available
Url : http://mail.python.org/pipermail/new-bugs-announce/attachments/20071124/c6b09051/attachment.py
More information about the New-bugs-announce