Author pekka.klarck
Recipients hpk, pekka.klarck, srid, vinay.sajip
Date 2012-03-08.14:54:37
SpamBayes Score 3.77165e-10
Marked as misclassified No
Message-id <1331218479.48.0.416157756668.issue6333@psf.upfronthosting.co.za>
In-reply-to
Content
The same problem that caused problems to py.test caused problems also to Robot Framework:
http://code.google.com/p/robotframework/issues/detail?id=1079

I was surprised to notice this issue was closed as invalid although the problem didn't occur with Python 2.7 anymore. After a little more digging I noticed that the proposed fix has actually been done in r84282 as part of fixing issue 9051. The fix doesn't check for `closed` attribute but instead silences possible ValueError.

We also noticed a variation of the problem: If the registered handler ever tries to write anything to its stream you also get an exception. We decided to silence all these errors with this code:

import logging
logging.raiseExceptions = False

Finally, I consider it a separate bug that logging.StreamHandler uses sys.stderr by default. It should use sys.__stderr__ instead.
History
Date User Action Args
2012-03-08 14:54:39pekka.klarcksetrecipients: + pekka.klarck, vinay.sajip, srid, hpk
2012-03-08 14:54:39pekka.klarcksetmessageid: <1331218479.48.0.416157756668.issue6333@psf.upfronthosting.co.za>
2012-03-08 14:54:38pekka.klarcklinkissue6333 messages
2012-03-08 14:54:38pekka.klarckcreate