[Python-bugs-list] [ python-Bugs-451309 ] don't store traceback objects

noreply@sourceforge.net noreply@sourceforge.net
Wed, 15 Aug 2001 13:36:17 -0700


Bugs item #451309, was opened at 2001-08-15 13:36
You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=105470&aid=451309&group_id=5470

Category: Python Library
Group: None
Status: Open
Resolution: None
Priority: 6
Submitted By: Jeremy Hylton (jhylton)
Assigned to: Steve Purcell (purcell)
Summary: don't store traceback objects

Initial Comment:
A TestResult object stores the exceptions raised when
tests fail.  The only use of these stored tracebacks,
it seems, is to print a stack trace when the test run's
report is generated.

The traceback objects, however, keep pointers to a bunch
of objects that might otherwise be garbage collected. 
I ran into this on Windows, where the traceback was
keeping a file object alive.  Because the file object
was not collected, my tearDown() method could not
remove the file.

This patch changes unittest to generate the formatted
traceback immediately, so that it does not keep
tracebacks around any longer than needed.


----------------------------------------------------------------------

You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=105470&aid=451309&group_id=5470