Skip to content
This repository

use of Tracer() when debugging works but gives error messages #692

Closed
jorgsk opened this Issue August 10, 2011 · 1 comment

2 participants

jorgsk Min RK
jorgsk

When I want to debug a certain part of my code, I use the Tracer function from the debugging inside my code like this:

from IPython.core.debugger import Tracer
Tracer()

Before 0.11 this would dump the user into debugging mode at this point in the code flow.

In 0.11 this also happens. However, when exiting debugging mode with 'q', errors are thrown:

ipdb> q
---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
/home/jorgsk/work/3UTR/ in ()
----> 1 get_ipython().magic(u"run annotation_parser.py")

/usr/local/lib/python2.7/dist-packages/IPython/core/interactiveshell.pyc in magic(self, arg_s, next_input)
   1892                 self._magic_locals = sys._getframe(1).f_locals
   1893             with self.builtin_trap:
-> 1894                 result = fn(magic_args)
   1895             # Ensure we're not keeping object references around:

   1896             self._magic_locals = {}

/usr/local/lib/python2.7/dist-packages/IPython/core/magic.pyc in magic_run(self, parameter_s, runner, file_finder)
   1703                         else:
   1704                             # regular execution

-> 1705                             runner(filename,prog_ns,prog_ns,exit_ignore=exit_ignore)
   1706 
   1707                 if opts.has_key('i'):

/usr/local/lib/python2.7/dist-packages/IPython/core/interactiveshell.pyc in safe_execfile(self, fname, *where, **kw)
   2184         with prepended_to_syspath(dname):
   2185             try:
-> 2186                 execfile(fname,*where)
   2187             except SystemExit, status:
   2188                 # If the call was made with 0 or None exit status (sys.exit(0)


/usr/local/lib/python2.7/dist-packages/IPython/core/interactiveshell.pyc in showtraceback(self, exc_tuple, filename, tb_offset, exception_only)
   1542                     # FIXME: Old custom traceback objects may just return a

   1543                     # string, in that case we just put it into a list

-> 1544                     stb = self.CustomTB(etype, value, tb, tb_offset)
   1545                     if isinstance(ctb, basestring):
   1546                         stb = [stb]

TypeError: BdbQuit_IPython_excepthook() takes exactly 4 arguments (5 given)

Further, when running with pdb ON, this error throws you into debugging mode again, forcing another 'q' before you are properly returned to the non-debugging shell.

Min RK minrk referenced this issue from a commit October 14, 2011
Commit has since been removed from the repository and is no longer available.
Min RK minrk referenced this issue from a commit October 14, 2011
Commit has since been removed from the repository and is no longer available.
Min RK minrk referenced this issue from a commit in minrk/ipython October 14, 2011
Min RK protect IPython from bad custom exception handlers
Previously, errors in custom handlers would result in the custom exception
handler's error being printed in lieu of the real exception, and certain cases could cause infinite loops.

Now, if CustomTB fails it is unregistered immediately, and the original TB is also displayed.

IPython's own BdbQuit_IPython_excepthook had an invalid signature, which revealed this issue, and has also been fixed.

test included.

closes #692
ed5078c
Min RK minrk closed this October 18, 2011
Min RK
Owner

closed by #876

Brian E. Granger ellisonbg referenced this issue from a commit January 10, 2012
Commit has since been removed from the repository and is no longer available.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.