diff options
author | Vinay Sajip <vinay_sajip@yahoo.co.uk> | 2009-05-09 12:07:17 (GMT) |
---|---|---|
committer | Vinay Sajip <vinay_sajip@yahoo.co.uk> | 2009-05-09 12:07:17 (GMT) |
commit | f9b01fe692515eabf555bbc40b458b195f46a807 (patch) | |
tree | b1a7b79902b93e7c5aaac70d9d4a20e696d2fc39 /Lib/logging | |
parent | 812d77152e489cf2436691fb6ce28b6fce8f2fec (diff) | |
download | cpython-f9b01fe692515eabf555bbc40b458b195f46a807.zip cpython-f9b01fe692515eabf555bbc40b458b195f46a807.tar.gz cpython-f9b01fe692515eabf555bbc40b458b195f46a807.tar.bz2 |
Issue #5971: StreamHandler.handleError now swallows IOErrors which occur when trying to print a traceback.
Diffstat (limited to 'Lib/logging')
-rw-r--r-- | Lib/logging/__init__.py | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/Lib/logging/__init__.py b/Lib/logging/__init__.py index b499c28..456dec9 100644 --- a/Lib/logging/__init__.py +++ b/Lib/logging/__init__.py @@ -720,8 +720,12 @@ class Handler(Filterer): """ if raiseExceptions: ei = sys.exc_info() - traceback.print_exception(ei[0], ei[1], ei[2], None, sys.stderr) - del ei + try: + traceback.print_exception(ei[0], ei[1], ei[2], None, sys.stderr) + except IOError: + pass # see issue 5971 + finally: + del ei class StreamHandler(Handler): """ |