Pydev debugger and atexit handlers

  • F. Oliver Gathmann

    When running a Python process that registers a custom cleanup callback using the atexit.register facilities of the builtin library under the Pydev debugger, shutdown fails without any traceback information in the call to sys.exit(0) in line 440 of the module.

    The problem appears to be that the debugger seems to trace the shutdown routines; if I add a sys.settrace(None) just before the sys.exit() call in line 440, everything works fine (although that surely is anything but a proper fix...).

    I also have to make sure the atexit cleanup handlers don't print anything to sys.stdout which is not a problem when I run the same program from a shell.

    Any further insight into these issues is greatly appreciated,


    • Fabio Zadrozny

      Fabio Zadrozny - 2006-12-09

      Hi Oliver,

      I'm having some trouble duplicating your behaviour...

      I've tried it with the code below, and it seems to work for me... Also, I think that you should report that in the bug-tracker... Check for more details on the bug-reporting guidelines (so, maybe you could paste some code to help me reproduce it).



      ---------- Code I used to test ------------

      import atexit

      def bla(*args, **kwargs):
          print args, kwargs

      class Foo(object):
          def __init__(self):
      if __name__ == '__main__':