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 BTaskaya, gvanrossum, lys.nikolaou, pablogsal, terry.reedy
Date 2020-05-08.21:37:07
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1588973828.6.0.0716946748145.issue40546@roundup.psfhosted.org>
In-reply-to
Content
I verified that 3.8 puts the caret under '|', and agree that this is bug that should be fixed at least in a new version.  Other such bugs have been fixed in the past.

tk Text widgets have 1-based line numbers and 0-based column numbers. The latter is appropriate since column indexes mostly serve as slice positions rather than as character positions.  IDLE changes the background of the error character to red, so it must be subtracting 1 to get the beginning of the slice to be colored.  There was once a bug about this, so having the CPython behavior be consistent and documented would be good even if not a language feature.  (For some reason I have not yet tracked down, IDLE colors the \n in 3.8 as well as 3.9, but is also correct and consistent for other exceptions where the two versions report the same column.)

On a related note: Since the exceptions raised by compile are not restricted to SyntaxError (or Warning), it would be nice to have them restricted to a definite list that is documented.  Both code.InteractiveInterpreter and IDLE have try-compile-except with (different) tuples extended as uncaught exceptions are reported.
History
Date User Action Args
2020-05-08 21:37:08terry.reedysetrecipients: + terry.reedy, gvanrossum, lys.nikolaou, pablogsal, BTaskaya
2020-05-08 21:37:08terry.reedysetmessageid: <1588973828.6.0.0716946748145.issue40546@roundup.psfhosted.org>
2020-05-08 21:37:08terry.reedylinkissue40546 messages
2020-05-08 21:37:07terry.reedycreate