"When printing tracebacks, the interpreter will now point to the exact
expression that caused the error instead of just the line."

I get the motivation for better error messages, but there are scenarios
where you can't provide useful new information.  I've been lax in
getting to testing the project I work on with 3.11, but here's some spew
from one testcase (this is an intentionally triggered error - the
testcase is testing predictable behavior in the face of this error, 3.11
didn't *cause* this, as can be fairly easily seen):

Traceback (most recent call last):
  File "C:\Users\mats\Documents\github\scons\SCons\Script\Main.py", line
1403, in main
    _exec_main(parser, values)
    ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\mats\Documents\github\scons\SCons\Script\Main.py", line
1366, in _exec_main
    _main(parser)
    ^^^^^^^^^^^^^
  File "C:\Users\mats\Documents\github\scons\SCons\Script\Main.py", line
1034, in _main
    SCons.Script._SConscript._SConscript(fs, script)
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File
"C:\Users\mats\Documents\github\scons\SCons\Script\SConscript.py", line
285, in _SConscript
    exec(compile(scriptdata, scriptname, 'exec'), call_stack[-1].globals)
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File
"C:\Users\mats\AppData\Local\Temp\testcmd.16164.fpv9xt5b\SConstruct",
line 4, in <module>
    raise InternalError('error inside')
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
SCons.Errors.InternalError: error inside


The grump here is all those pointy hats added absolutely zero new
information, because in each case the entire line is underlined.  So the
"benefit" of the change is the traceback went from 12 lines to 17. In
many cases tracebacks are much longer and adding lots of not-useful
lines is not a great thing.

A thought - how about omitting the underline line if the
to-be-underlined part would be the whole line?
_______________________________________________
Python-Dev mailing list -- python-dev@python.org
To unsubscribe send an email to python-dev-le...@python.org
https://mail.python.org/mailman3/lists/python-dev.python.org/
Message archived at 
https://mail.python.org/archives/list/python-dev@python.org/message/ST3PMOO6JPOYKI2EJAAFL5X2SZL353R6/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to