[issue13044] pdb throws AttributeError at end of debugging session

Xavier de Gaye report at bugs.python.org
Wed Dec 5 18:22:56 CET 2012


Xavier de Gaye added the comment:

> On finalizing pdb can stop working at some time, but debugging on
> finalization stage can be still useful in certain cases.

Agreed that debugging on finalization stage is useful. Debugging on
finalization stage does not seem to work though:

===============================
class C:
    def __del__(self):
        print('deleted')

c = C()
import pdb; pdb.set_trace()
x = 1
===============================
$ python3 bar.py
> /tmp/bar.py(7)<module>()
-> x = 1
(Pdb) step
--Return--
> /tmp/bar.py(7)<module>()->None
-> x = 1
(Pdb) step
deleted
$
===============================


Maybe this is another issue.


> Xavier, your proposition noticeably changes current behavior as I understand
> it.  For now set_trace() works as breakpoint set up by program, you can go
> out of debugged function and it's very convenient from my perspective.

This proposition only sets the global trace function to None on
returning from the bottom frame, i.e. the oldest frame in the stack. So you can
still use  set_trace() as a hard-coded breakpoint and continue the debugging
session out of the debugged function.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue13044>
_______________________________________


More information about the Python-bugs-list mailing list