ENH: now we know that logging handlers closing was still buggy in 2.6.2

This commit is contained in:
Yaroslav Halchenko
2013-05-12 22:55:02 -04:00
parent 571ff33fde
commit 21474884e0

View File

@@ -377,10 +377,11 @@ class Server:
handler.flush()
handler.close()
except (ValueError, KeyError): # pragma: no cover
if sys.version_info >= (2,6):
raise
# is known to be thrown after logging was shutdown once
# Is known to be thrown after logging was shutdown once
# with older Pythons -- seems to be safe to ignore there
# At least it was still failing on 2.6.2-0ubuntu1 (jaunty)
if sys.version_info >= (2,6,3):
raise
# tell the handler to use this format
hdlr.setFormatter(formatter)
logging.getLogger("fail2ban").addHandler(hdlr)