#78 ignored AttributeError exception (pdb)

pdb (9)
Xavier de Gaye

Pyclewn: 1.6
Python 3.2
Debugger: pdb


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


  • Xavier de Gaye
    Xavier de Gaye

    Fixed at changeset id 64132057bb70

    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

    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]

    vim.py pydb.py

  • Xavier de Gaye
    Xavier de Gaye

    • status: open --> closed-fixed