summaryrefslogtreecommitdiffstats
path: root/Lib/logging
diff options
context:
space:
mode:
authorVinay Sajip <vinay_sajip@yahoo.co.uk>2009-05-09 12:07:17 (GMT)
committerVinay Sajip <vinay_sajip@yahoo.co.uk>2009-05-09 12:07:17 (GMT)
commitf9b01fe692515eabf555bbc40b458b195f46a807 (patch)
treeb1a7b79902b93e7c5aaac70d9d4a20e696d2fc39 /Lib/logging
parent812d77152e489cf2436691fb6ce28b6fce8f2fec (diff)
downloadcpython-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__.py8
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):
"""