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 ezio.melotti, flox, georg.brandl, giampaolo.rodola, icordasc, lesmana, ncoghlan, petri.lehtinen, psss, terry.reedy
Date 2013-04-30.00:33:34
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
This is an enhancement request (at best), not a bug report. I would close it because I think it somewhat dubious, unreasonable, and not helpful.

First, I think tracebacks *should* report 'the spot of the foul' for each call frame. What would sometimes be helpful when multiple operations are performed in one line would be to also have the column number reported, along with a ^ to indicate the exact point of error. So I think instead misreporting the location of an instruction pointer could be deceptive and not helpful.

I think it unreasonable to ask the traceback reporter to guess which one line would be most helpful to report. The OP suggests somehow tracing back to the *first* line of a multiline statement. But on python-ideas, G. Rodola noted the following

assert \
    1 == 0, \
Traceback (most recent call last):
  File "", line 3, in <module>
AssertionError: error

and requested that the *second* or *middle* line should be reported. (But what if the asserted expression itself covered multiple lines?)

I say sometimes 'not helpful' since the traceback already says what function the pointer is in, if it is in one, and therefore what function what called by the previous frame. In the 'reproducer', 'raise Exception' is in fun1, so in fun2, 'par="value")' must have been preceded by 'fun1(...' on a previous line. So replacing 'par="value")' with 'fun1(...' would not add information.

I think debugging multiline statements will usually requires looking at the whole statement and a few more. To make this easy, one can use a more sophisticated environment than dumb consoles. For instance, if one executes a top-level script from an Idle edit window, one can right click on a traceback in the Shell window and select 'Go to file/line'. Idle will open the file, if necessary, and highlight the line.
Date User Action Args
2013-04-30 00:33:36terry.reedysetrecipients: + terry.reedy, georg.brandl, ncoghlan, giampaolo.rodola, ezio.melotti, psss, flox, lesmana, petri.lehtinen, icordasc
2013-04-30 00:33:36terry.reedysetmessageid: <>
2013-04-30 00:33:35terry.reedylinkissue12458 messages
2013-04-30 00:33:34terry.reedycreate