Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

stacktrace: fix missing caller frames and remove carets from vd_cli() traces #2651

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from

Conversation

midichef
Copy link
Contributor

4df7308 fixes a bug in #2586. The caller of stacktrace() was being removed in too many cases, like in getCell(). Now the only caller of stacktrace that is removed is exceptionCaught().

Test case: vd = 1+[] z^E and note how there is no line that ends with in getCell until after applying 4df7308.

aa4285b cleans up the carets in tracebacks from vd_cli (seen in Python 3.11 and up). Like in the traceback when an HTTP connection closes:

  File "/usr/lib/python3.12/http/client.py", line 331, in begin
    version, status, reason = self._read_status()
                              ^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/http/client.py", line 300, in _read_status
    raise RemoteDisconnected("Remote end closed connection without"
http.client.RemoteDisconnected: Remote end closed connection without response

You can test this with netcat: nc -l -p 2000 -w 1& vd http://localhost:2000/

I tested aa4285b in the most recent Python major versions from 3.8-3.12.

Note that the new exception formatting will not happen for events like KeyboardInterrupt. So the carets will be seen if you do vd /dev/zero then hit ^C.

Callers like getCell() were being wrongly excluded.

Also fixes IndexError when trimming short call stacks, three levels deep.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants