[New-bugs-announce] [issue36376] Wrong position of SyntaxError in IDLE

Vedran Čačić report at bugs.python.org
Tue Mar 19 22:23:08 EDT 2019


New submission from Vedran Čačić <vedgar at gmail.com>:

Open IDLE, New File, put this inside:

    'abcde\
    ')
    x = 123456789

And try to Run Module. Of course, the syntax error is extra ) at the end of the second line. But it is not highlighted. What's highlighted is 123 in the third line. Some additional observations:

* the length of the first line determines somehow what's highlighted in the third one: the longer the first line, more to the right the highlight goes in the third;

* third line can be whatever you want, it just needs to be long enough for a highlight to appear;

* you can even have blank lines between them;

* the same phenomenon appears if you use triple-quoted strings instead of single-quoted with backslash line continuation.

----------
messages: 338432
nosy: veky
priority: normal
severity: normal
status: open
title: Wrong position of SyntaxError in IDLE

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue36376>
_______________________________________


More information about the New-bugs-announce mailing list