Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6778181
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T16:14:13+00:00 2026-05-26T16:14:13+00:00

I recently switched from ipython0.10 to ipython0.11. In ipython0.11, I only see a small

  • 0

I recently switched from ipython0.10 to ipython0.11. In ipython0.11, I only see a small snippet of the full traceback when the python debugger engages (i.e. using %pdb), whereas in ipython0.10 I’d see the full traceback. As far as I can tell, the full traceback is not directly accessible from the pdb command line – you can navigate through it with ‘u’ but can’t see it directly.

So, is there any way to show the full traceback? Such as a configuration parameter?

Or, even more usefully, is there any way to have ipython just show the Exception that was caught, rather than showing where in the code it was caught?

EDIT: Example:

In [1]: pdb
Automatic pdb calling has been turned ON

In [2]: 1/0
> <ipython-input-2-05c9758a9c21>(1)<module>()
     -1 1/0

ipdb> q
---------------------------------------------------------------------------
ZeroDivisionError                         Traceback (most recent call last)
/Users/adam/<ipython-input-2-05c9758a9c21> in <module>()
----> 1 1/0

ZeroDivisionError: integer division or modulo by zero

I’d like to see the ZeroDivisionError before q‘ing out of the pdb.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T16:14:13+00:00Added an answer on May 26, 2026 at 4:14 pm

    is there any way to have ipython just show the Exception that was
    caught, rather than showing where in the code it was caught?

    You could use sys.excepthook:

    import sys
    
    def exc_hook(type, value, traceback):
        print type
    
    sys.excepthook = exc_hook
    

    From the sys module documentation:

    sys.excepthook(type, value, traceback)

    This function prints out a given traceback and exception to
    sys.stderr.

    When an exception is raised and uncaught, the interpreter calls
    sys.excepthook with three arguments, the exception class, exception
    instance, and a traceback object. In an interactive session this
    happens just before control is returned to the prompt; in a Python
    program this happens just before the program exits. The handling of
    such top-level exceptions can be customized by assigning another
    three-argument function to sys.excepthook.

    sys.__displayhook__
    sys.__excepthook__

    These objects contain the original values of displayhook and
    excepthook at the start of the program. They are saved so that
    displayhook and excepthook can be restored in case they happen to get
    replaced with broken objects.


    You can also try starting ipython with the --xmode option set to Plain

    From IPython reference:

    $ ipython [options] files
    
    --xmode=<modename>
    

    Mode for exception reporting.

    Valid modes: Plain, Context and Verbose.

    Plain: similar to python’s normal traceback printing.

    Context: prints 5 lines of context source code around each line in the traceback.

    Verbose: similar to Context, but additionally prints the variables currently visible where the exception happened (shortening their
    strings if too long). This can potentially be very slow, if you happen
    to have a huge data structure whose string representation is complex
    to compute. Your computer may appear to freeze for a while with cpu
    usage at 100%. If this occurs, you can cancel the traceback with
    Ctrl-C (maybe hitting it more than once).

    Here are some example usages. Notice the difference in lines for each traceback:

    --xmode=Plain:

    [ 19:55 jon@hozbox ~/SO/python ]$ ipython --xmode=Plain ipython-debugger-full-traceback-on-interactive-pdb.py 
    ------------------------------------------------------------
    Traceback (most recent call last):
      File "ipython-debugger-full-traceback-on-interactive-pdb.py", line 2, in <module>
        1 / 0
    ZeroDivisionError: integer division or modulo by zero
    

    --xmode=Context:

    [ 19:55 jon@hozbox ~/SO/python ]$ ipython --xmode=Context ipython-debugger-full-traceback-on-interactive-pdb.py 
    ---------------------------------------------------------------------------
    ZeroDivisionError                         Traceback (most recent call last)
    
    /home/jon/SO/python/ipython-debugger-full-traceback-on-interactive-pdb.py in <module>()
          1 
    ----> 2 #!/usr/bin/python
          3 1 / 0
          4 
          5 
    
    ZeroDivisionError: integer division or modulo by zero
    

    --xmode=Verbose:

    [ 19:54 jon@hozbox ~/SO/python ]$ ipython --xmode=Verbose ipython-debugger-full-traceback-on-interactive-pdb.py 
    ---------------------------------------------------------------------------
    ZeroDivisionError                         Traceback (most recent call last)
    
    /home/jon/SO/python/ipython-debugger-full-traceback-on-interactive-pdb.py in <module>()
          1 
    ----> 2 #!/usr/bin/python
          3 1 / 0
          4 
          5 
    
    ZeroDivisionError: integer division or modulo by zero
    

    And without specifying a .py file:

    --xmode=Plain:

    [ 19:55 jon@hozbox ~/SO/python ]$ ipython --xmode=Plain
    
    In [1]: 1 / 0
    ------------------------------------------------------------
    Traceback (most recent call last):
      File "<ipython console>", line 1, in <module>
    ZeroDivisionError: integer division or modulo by zero
    

    --xmode=Context:

    [ 20:03 jon@hozbox ~/SO/python ]$ ipython --xmode=Context
    
    In [1]: 1 / 0
    ---------------------------------------------------------------------------
    ZeroDivisionError                         Traceback (most recent call last)
    
    /home/jon/SO/python/<ipython console> in <module>()
    
    ZeroDivisionError: integer division or modulo by zero
    

    --xmode=Verbose:

    [ 20:01 jon@hozbox ~/SO/python ]$ ipython --xmode=Verbose
    
    
    In [1]: 1 / 0
    ---------------------------------------------------------------------------
    ZeroDivisionError                         Traceback (most recent call last)
    
    /home/jon/SO/python/<ipython console> in <module>()
    
    ZeroDivisionError: integer division or modulo by zero
    

    Using the Python debugger.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I recently switched from using Linq to Sql to the Entity Framework. One of
I've recently switched from being an employee of a small consulting company to being
I recently switched from using screen to tmux (obtained through macports), as I like
I recently switched out log4net logging from using config files to being set up
UPDATE: Solution at bottom. I recently switched from using a set up such as
I have been using rspec for a little while and recently switched style from
I recently switched from using NSTimer to CVDisplayLink to redraw my OpenGL animation, but
I have recently switched from using Eclipse to IntelliJ, and am preferring the experience.
I have recently switched from python 2.7 to python 3.2 considering following folder structure:
I've just recently switched over to using 64-bit Python 2.6.1 on Mac OS X

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.