Author Topic: Python stack trace, double click on any trace line to go to that file/line  (Read 296 times)

rowbearto

  • Senior Community Member
  • Posts: 1487
  • Hero Points: 113
When I run a Python program and it has an error, I'd like to click on any line of the trace output and go to the file/line it is referring to.

For example, from pymsgs.tar.gz that I recently uploaded to support, there is a stack trace:

Code: [Select]
Traceback (most recent call last):
  File "/home/rbresali/nasdirs/nas/sebugs/pymsgs/pymsgs.py", line 8, in <module>
    main()
  File "/home/rbresali/nasdirs/nas/sebugs/pymsgs/pymsgs.py", line 6, in main
    func1()
  File "/home/rbresali/nasdirs/nas/sebugs/pymsgs/pymsgs.py", line 3, in func1
    raise RuntimerError("Error on purpose")
NameError: name 'RuntimerError' is not defined

I'd like to be able to double click on any of the above lines with ' File "", line #' and go to that line number.

When I debug in Eclipse pydev it provides hyperlinks for these lines so you can go to those files. Would be nice to have equivalent functionality in SlickEdit.

patrick

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 1141
  • Hero Points: 107
Re: Python stack trace, double click on any trace line to go to that file/line
« Reply #1 on: September 30, 2019, 06:09:02 pm »
That's strange, I expected that just the default error parsing entry would do that, but for me it brings up the file referenced, but doesn't go to the correct line.  I'll take a look at it.

rowbearto

  • Senior Community Member
  • Posts: 1487
  • Hero Points: 113
I think the default error parsing should only take one to the final line with an error as that is the one that generates the error. This is what it does now and I think that is correct.

Would be nice to have other means to go to the other lines in the stack trace though, perhaps a right click entry? In eclipse each line of the stack trace is a hyperlink, that would also be real nice. Could probably write a macro to right click on the line and have an entry "Go to python file/line" for stack trace entries.