This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author terry.reedy
Recipients flox, r.david.murray, terry.reedy
Date 2013-04-26.21:58:17
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1367013497.4.0.451648929752.issue17825@psf.upfronthosting.co.za>
In-reply-to
Content
Perhaps Florent is pointing to the fact that for 'except X:', the syntax error is detected at the ' ' at offset 6 but the caret is backed up under the 't' at offset 5*, whereas it is not backed up to the space before '    open'. Which behavior do you propose to change?

Since these details of presentation are not documented, I do not consider the current difference a bug. I would not change them in current versions since change could confuse people or software. I suspect there is also danger of making some cases worse. For the same reasons, I would not change in future versions either without good offsetting reason. So I also think this should be closed.

On python-list, we tell people that the caret is a starting point for detecting the error, not an absolute pointer.

For syntax errors, Idle omits the traceback and highlights in red the presumed error. For the first, it marks the entire word 'except'. For the second, it marks the last whitespace before open. This is equivalent to backing up the caret.

* I suspect this backup is special to keywords. For 'except+', both systems also mark the keyword, not the '+'. Either the keyword is misused or is a regular name misspelled. In either case, someone thought it better to point to the keyword than the space or other character after. I agree. So did the Idle author who decided to highlight the keyword rather than the character after it.
History
Date User Action Args
2013-04-26 21:58:17terry.reedysetrecipients: + terry.reedy, r.david.murray, flox
2013-04-26 21:58:17terry.reedysetmessageid: <1367013497.4.0.451648929752.issue17825@psf.upfronthosting.co.za>
2013-04-26 21:58:17terry.reedylinkissue17825 messages
2013-04-26 21:58:17terry.reedycreate