Skip to content

[RFC] pdb: display stacktrace on quit? #4293

@blueyed

Description

@blueyed

Python itself displays the stacktrace for BdbQuit. Should we also display it, possibly with any test summary?

-> print("hello18")
(Pdb) q
Traceback (most recent call last):
  File "test_pdb.py", line 17, in <module>
    test_1()
  File "test_pdb.py", line 8, in test_1
    print("hello18")
  File "test_pdb.py", line 8, in test_1
    print("hello18")
  File "…/pyenv/3.6.6/lib/python3.6/bdb.py", line 51, in trace_dispatch
    return self.dispatch_line(frame)
  File "…/pyenv/3.6.6/lib/python3.6/bdb.py", line 70, in dispatch_line
    if self.quitting: raise BdbQuit
bdb.BdbQuit

When using Exit or Interrupted it will not display any of those.

  1. should there be an option on Exit (similar to returncode) to display
    traceback and test summary, as with a failed test?

An option (hack?) might be to raise Failed (that's how BdbQuit gets up
handled currently (in master)), and set a flag on the session to stop? (basically exitfirst then)

  1. would Interrupted (from/on Session) be more appropriate here than Exit?

  2. should there be an option for this behavior(s)?
    After all I like that currently on features it exits rather cleanly with
    "Exiting debugger", without stacktrace and "short test summary info" etc.

Metadata

Metadata

Assignees

No one assigned

    Labels

    plugin: debuggingrelated to the debugging builtin plugin

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions