[Python-checkins] r72506 - in python/trunk: Lib/logging/__init__.py Misc/NEWS

vinay.sajip python-checkins at python.org
Sat May 9 14:07:17 CEST 2009


Author: vinay.sajip
Date: Sat May  9 14:07:17 2009
New Revision: 72506

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

Modified:
   python/trunk/Lib/logging/__init__.py
   python/trunk/Misc/NEWS

Modified: python/trunk/Lib/logging/__init__.py
==============================================================================
--- python/trunk/Lib/logging/__init__.py	(original)
+++ python/trunk/Lib/logging/__init__.py	Sat May  9 14:07:17 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/trunk/Misc/NEWS
==============================================================================
--- python/trunk/Misc/NEWS	(original)
+++ python/trunk/Misc/NEWS	Sat May  9 14:07:17 2009
@@ -28,7 +28,7 @@
 - Issue #4426: The UTF-7 decoder was too strict and didn't accept some legal
   sequences. Patch by Nick Barnes and Victor Stinner.
 
-- Issue #1588: Add complex.__format__. For example, 
+- Issue #1588: Add complex.__format__. For example,
   format(complex(1, 2./3), '.5') now produces a sensible result.
 
 - Issue #5864: Fix empty format code formatting for floats so that it
@@ -285,9 +285,12 @@
 Library
 -------
 
+- Issue #5971: StreamHandler.handleError now swallows IOErrors which occur when
+  trying to print a traceback.
+
 - Issue #5976: Fixed Distutils test_check_environ.
 
-- Issue #5900: Ensure RUNPATH is added to extension modules with RPATH if GNU 
+- Issue #5900: Ensure RUNPATH is added to extension modules with RPATH if GNU
   ld is used. Original patch by Floris Bruynooghe.
 
 - Issue #5941: Distutils build_clib command was not working anymore because
@@ -323,7 +326,7 @@
 
 - Issue #2245: aifc now skips chunk types it doesn't recognize, per spec.
 
-- Issue #5874: distutils.tests.test_config_cmd is not locale-sensitive 
+- Issue #5874: distutils.tests.test_config_cmd is not locale-sensitive
   anymore.
 
 - Issue #4305: ctypes should now build again on mipsel-linux-gnu
@@ -899,7 +902,7 @@
   linker, rather than always exit successfully. Patch by Floris Bruynooghe.
 
 - Issue #4587: Add configure option --with-dbmliborder=db1:db2:... to specify
-  the order that backends for the dbm extension are checked. 
+  the order that backends for the dbm extension are checked.
 
 - Link the shared python library with $(MODLIBS).
 


More information about the Python-checkins mailing list