Author hpk
Recipients hpk, srid, vinay.sajip
Date 2009-07-09.10:47:44
SpamBayes Score 2.55208e-08
Marked as misclassified No
Message-id <1247136466.51.8.5141820455e-06.issue6333@psf.upfronthosting.co.za>
In-reply-to
Content
I think the issue is unrelated to py.test - it just presents a use case
as it wants to run 1000's of tests and capture stdout/stderr per each
test function, cannot guess about a test's logging-usage yet wants to
minimize memory/resource usage and close any temporary files it opens.  

Anyway, a standalone minimal example involving the issue is this:

import logging
import StringIO
stream = StringIO.StringIO()
logging.basicConfig(stream=stream)
stream.close() # to free memory/release resources

At exit logging's shutdown() will try to flush/close resulting in an
exception.  Is it a problem to have the logging module be a bit more
defensive and only try a flush/close if the stream isn't already closed?
History
Date User Action Args
2009-07-09 10:47:46hpksetrecipients: + hpk, vinay.sajip, srid
2009-07-09 10:47:46hpksetmessageid: <1247136466.51.8.5141820455e-06.issue6333@psf.upfronthosting.co.za>
2009-07-09 10:47:45hpklinkissue6333 messages
2009-07-09 10:47:44hpkcreate