#78 ignored AttributeError exception (pdb)

closed-fixed
pdb (9)
3
2011-07-20
2011-07-19
Xavier de Gaye
No

Pyclewn: 1.6
Python 3.2
Debugger: pdb

Description:

The following exception is raised and ignored on termination of the
program debugged by ``pdb``:
AttributeError("'NoneType' object has no attribute 'Pdb'",) in
function _removeHandlerRef

Discussion

  • Xavier de Gaye
    Xavier de Gaye
    2011-07-20

    Fixed at changeset id 64132057bb70

    Solution:
    This bug exists with Python 3.2, where the ``logging`` standard module
    introduced the use of ``weakref`` variables.

    Fix: the ``Clewn-thread`` handling the netbeans communication with
    Vim, is a daemon thread. The main thread that runs the program being
    debbuged by ``pdb`` must signal the ``Clewn-thread`` that it is about
    to exit and join this thread so that the daemon can stop the debugging
    session and terminate before Python starts cleaning up. See
    http://bugs.python.org/issue1722344 about Python termination and
    module teardown, excerpts::

    When Python begins to shutdown it takes each module and sets each
    variable in the global namespace to None. If a thread has not
    terminated before the interpreter terminates then the thread tries
    to use a global variable which has been set to None.
    This is not about to change since this occurs because of coding
    "errors". You must make sure that either your thread is as safe as
    a __del__ method (which means no global namespace access) or you
    can't let the app exit until you are positive all of your threads
    have terminated, not just asked them to shutdown since this is all
    asynchronous.

    This also fixes the following bug in ``test_bp_open_file``::

    IndexError: deque index out of range
    File "/usr/local/lib/python3.2/asynchat.py", line 266, in initiate_send
    del self.producer_fifo[0]

    Files:
    vim.py pydb.py

     
  • Xavier de Gaye
    Xavier de Gaye
    2011-07-20

    • status: open --> closed-fixed