New submission from Adam Bartoš:

Consider the following code:
>>> 1, 2
  File "<stdin>", line 1
    1, 2
       ^
SyntaxError: invalid character in identifier

The error is due to the fact, that the space before "2" is actually a 
non-breaking space. The error message and the position of the caret is 
misleading.

The tokenize module gives an ERRORTOKEN at the position of the space, so 
shouldn't the massage be more like "invalid syntax" with the correct position 
or even something more appropriate?

----------
components: Interpreter Core, Unicode
messages: 258584
nosy: Drekin, ezio.melotti, haypo
priority: normal
severity: normal
status: open
title: A non-breaking space in a source
type: behavior
versions: Python 3.6

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue26152>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to