[New-bugs-announce] [issue23518] Misplaced diagnostic caret for some SyntaxErrors

Zack Weinberg report at bugs.python.org
Wed Feb 25 03:58:19 CET 2015


New submission from Zack Weinberg:

I tripped over a couple of SyntaxError cases where the diagnostic caret is misplaced.

    >>> While x:
      File "<stdin>", line 1
        While x:
              ^
    SyntaxError: invalid syntax

The caret should point to the capital W in 'While'.

    >>> for x in the range(10):
      File "<stdin>", line 1
        for x in the range(10):
                         ^
    SyntaxError: invalid syntax

The caret should point to the 'the'.

----------
messages: 236560
nosy: zwol
priority: normal
severity: normal
status: open
title: Misplaced diagnostic caret for some SyntaxErrors

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue23518>
_______________________________________


More information about the New-bugs-announce mailing list