This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author skip.montanaro
Recipients
Date 2005-01-09.01:59:10
SpamBayes Score
Marked as misclassified
Message-id
In-reply-to
Content
I think it would be useful to sometimes have local variable
values printed with tracebacks and stack frames.  The
attached patch is a first cut at that.  I don't know if
people would want that as the default, so I've defaulted
argument printing to disabled.  With arg printing enabled,
executing this script:

#!/usr/bin/env python

import sys
import traceback

def exch(ty, val, tb):
    traceback.print_exception(ty, val, tb, args=True)
sys.excepthook = exch

def f(n,d):
    return n/d

def g(a):
    return a/(a-1)

for i in range(5,-1,-1):
    print g(i)

displays this output:

1
1
1
2
Traceback (most recent call last):
  File "/Users/skip/tmp/tb.py", line 17, in ?
    print g(i)
       exch: <function exch at 0x4c46b0>
       f: <function f at 0x441330>
       g: <function g at 0x441370>
       i: 1
  File "/Users/skip/tmp/tb.py", line 14, in g
    return a/(a-1)
       a: 1
ZeroDivisionError: integer division or modulo by zero
History
Date User Action Args
2007-08-23 15:41:12adminlinkissue1098732 messages
2007-08-23 15:41:12admincreate