question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

v8 Errors: input line numbers missing

See original GitHub issue

I quite like the new (v8) simple format for syntax and other compile errors from Input, like Input In [25]. But compared to the old (v7) error header with pseudo-files (e.g. File "<ipython-input-6-9e0b5ab16b5e>", line 4), the line number has gone missing. There are tools which parse iPython’s errors which will be missing this line information. This is also particularly problematic for syntax/indentation errors in Plain style with multi-line input:

In [25]: if True:
    ...:     same_var = 1
    ...: else:
    ...:    same_var = 2
    ...:     same_var = 1
    ...:     same_var = 1
  Input In [25]
    same_var = 1
    ^
IndentationError: unexpected indent

I think Input In [25], line 5 would be perfect, or, for consistency with the file version, Input In [25]:5.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:8 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
jdtsmithcommented, Mar 27, 2022

Hi @MrMino, just checking on the status of this issue. I have tooling standing by to learn the final decision on restoring line numbers for input blocks across the board. Thanks.

0reactions
jdtsmithcommented, Apr 21, 2022

In case you haven’t checked in on PR #13560 recently, I got confirmation that the <cell line...> stuff was no longer needed and can be reverted. I also went ahead a just pushed the small change changing “Input cell” -> “Cell” for a short and consistent layout. Let me know if you see anything else needed in #13560 before it could be merged.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Accessing line number in V8 JavaScript (Chrome & Node.js)
Object.defineProperty(global, '__stack', { get: function(){ var orig = Error.prepareStackTrace; Error.prepareStackTrace = function(_, stack){ return stack; }; ...
Read more >
Add / Remove Line Numbers - MZ-Tools 8.0 Help
VB.NET VB6 VBA. The Add / Remove Line Numbers feature allows you to add or remove line numbers to the source code of...
Read more >
How can I get my line numbers back inmy code file
Click on the tab labeled "'ASM' File Types". In the left column at the top, you'll need to place a check in the...
Read more >
Why don't the line numbers in an error message match the ...
If you are seeing error messages that are out by a number of lines, one thing you can check is that your source...
Read more >
src/messages.js - v8/v8 - Git at Google
@return {number} 0 if input too small, -1 if input too large,. else the line number. */. function ScriptLineFromPosition(position) {.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found