Issue with exception info formatting by traceback module

J

Jan Decaluwe

Hi:

There is a difference between exception info formatting by
the interpreter versus the traceback module. For example,
say we define an exception Error in file module.py:

[jand@localhost jand]$ python
Python 2.3 (#1, Sep 12 2003, 15:05:00)
[GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2
Type "help", "copyright", "credits" or "license" for more information.Traceback (most recent call last):
.... raise module.Error("test")
.... except:
.... import traceback
.... print traceback.print_exc()
....
Traceback (most recent call last):
File "<stdin>", line 2, in ?
Error: test
None
In the second case, only the basename of the error is reported,
which is less clear. This is relevant because the unittest framework
uses the traceback module for exception reporting.

I believe the traceback module should be modified to mimic the
interpreter's behavior.

Regards, jan
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,764
Messages
2,569,566
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top