New submission from Nick Coghlan:

logging.shutdown includes a try/except block to avoid emitting spurious IO 
errors while the interpreter is shutting down. This fails if a registered 
handler tries to do IO (such as calling flush()) in its release method.

It would be better if the flush-and-close block was written as:

  try:
      hr.acquire()
      try:
          hr.flush()
          hr.close()
      finally:
          hr.release()
  except (IOError, ValueError):
    # Tolerate handlers that try to do IO in release()

----------
messages: 170635
nosy: ncoghlan
priority: normal
severity: normal
status: open
title: logging.shutdown should cope with IO errors from handler.release methods
versions: Python 2.7, Python 3.2, Python 3.3

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue15960>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to