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 Jason.Baker
Recipients Jason.Baker
Date 2010-04-30.20:34:30
SpamBayes Score 5.819904e-07
Marked as misclassified No
Message-id <1272659672.58.0.428458764285.issue8581@psf.upfronthosting.co.za>
In-reply-to
Content
The logging handler does not handle double-closing very well:

>>> from logging import StreamHandler
>>> h = StreamHandler()
>>> h.close()
>>> h.close()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib/python2.6/logging/__init__.py", line 705, in close
    del _handlers[self]
KeyError: <logging.StreamHandler instance at 0xb7609c8c>

There are two possible approaches to this:

 1. Raise a better error.
 2. Ignore the duplicate close.

This patch takes option 2 as this is likely not indicative of any kind of programmer error, but it shouldn't be too difficult to take option 1 instead.
History
Date User Action Args
2010-04-30 20:34:33Jason.Bakersetrecipients: + Jason.Baker
2010-04-30 20:34:32Jason.Bakersetmessageid: <1272659672.58.0.428458764285.issue8581@psf.upfronthosting.co.za>
2010-04-30 20:34:30Jason.Bakerlinkissue8581 messages
2010-04-30 20:34:30Jason.Bakercreate