[Python-checkins] r72507 - in python/branches/release26-maint: Lib/logging/__init__.py Misc/NEWS

vinay.sajip python-checkins at python.org
Sat May 9 14:11:30 CEST 2009


Author: vinay.sajip
Date: Sat May  9 14:11:30 2009
New Revision: 72507

Log:
Issue #5971: StreamHandler.handleError now swallows IOErrors which occur when trying to print a traceback.

Modified:
   python/branches/release26-maint/Lib/logging/__init__.py
   python/branches/release26-maint/Misc/NEWS

Modified: python/branches/release26-maint/Lib/logging/__init__.py
==============================================================================
--- python/branches/release26-maint/Lib/logging/__init__.py	(original)
+++ python/branches/release26-maint/Lib/logging/__init__.py	Sat May  9 14:11:30 2009
@@ -720,8 +720,12 @@
         """
         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):
     """

Modified: python/branches/release26-maint/Misc/NEWS
==============================================================================
--- python/branches/release26-maint/Misc/NEWS	(original)
+++ python/branches/release26-maint/Misc/NEWS	Sat May  9 14:11:30 2009
@@ -40,6 +40,9 @@
 Library
 -------
 
+- Issue #5971: StreamHandler.handleError now swallows IOErrors which occur when
+  trying to print a traceback.
+
 - Issue 5955: aifc's close method did not close the file it wrapped,
   now it does.  This also means getfp method now returns the real fp.
 


More information about the Python-checkins mailing list