##// END OF EJS Templates
Restore lineno's for Input mapped files (#13560)...
Restore lineno's for Input mapped files (#13560) * Implement lineno's for Input mapped files * Adopt In [123], line 123 format * Revert "Set co_name for cells run line by line. Fixes https://github.com/ipython/ipykernel/issues/841" (This reverts commit d11e987f174a15f1640f8006c86f58d884c3faa4.) * Omit mention of ", in <module>" for input tracebacks * Input cell -> Cell * Remove <module> from traceback doctests * Use f-string for `in ...' format * Simplify _format_list logic, converting to f-strings

File last commit:

r27686:a72418e2
r27686:a72418e2
Show More
restore-line-numbers.rst
50 lines | 1.5 KiB | text/x-rst | RstLexer
/ docs / source / whatsnew / pr / restore-line-numbers.rst
JD Smith
Restore lineno's for Input mapped files (#13560)...
r27686 Restore line numbers for Input
==================================
Line number information in tracebacks from input are restored.
Line numbers from input were removed during the transition to v8 enhanced traceback reporting.
So, instead of::
---------------------------------------------------------------------------
ZeroDivisionError Traceback (most recent call last)
Input In [3], in <cell line: 1>()
----> 1 myfunc(2)
Input In [2], in myfunc(z)
1 def myfunc(z):
----> 2 foo.boo(z-1)
File ~/code/python/ipython/foo.py:3, in boo(x)
2 def boo(x):
----> 3 return 1/(1-x)
ZeroDivisionError: division by zero
The error traceback now looks like::
---------------------------------------------------------------------------
ZeroDivisionError Traceback (most recent call last)
Cell In [3], line 1
----> 1 myfunc(2)
Cell In [2], line 2, in myfunc(z)
1 def myfunc(z):
----> 2 foo.boo(z-1)
File ~/code/python/ipython/foo.py:3, in boo(x)
2 def boo(x):
----> 3 return 1/(1-x)
ZeroDivisionError: division by zero
or, with xmode=Plain::
Traceback (most recent call last):
Cell In [12], line 1
myfunc(2)
Cell In [6], line 2 in myfunc
foo.boo(z-1)
File ~/code/python/ipython/foo.py:3 in boo
return 1/(1-x)
ZeroDivisionError: division by zero