[Python-checkins] cpython (2.7): Issue #19523: Closed FileHandler leak which occurred when delay was set.

vinay.sajip python-checkins at python.org
Fri Nov 15 21:43:02 CET 2013


http://hg.python.org/cpython/rev/bbb227b96c45
changeset:   87120:bbb227b96c45
branch:      2.7
parent:      87101:c178d72e2f84
user:        Vinay Sajip <vinay_sajip at yahoo.co.uk>
date:        Fri Nov 15 20:39:33 2013 +0000
summary:
  Issue #19523: Closed FileHandler leak which occurred when delay was set.

files:
  Lib/logging/__init__.py |  4 +++-
  Misc/NEWS               |  2 ++
  2 files changed, 5 insertions(+), 1 deletions(-)


diff --git a/Lib/logging/__init__.py b/Lib/logging/__init__.py
--- a/Lib/logging/__init__.py
+++ b/Lib/logging/__init__.py
@@ -912,8 +912,10 @@
                 self.flush()
                 if hasattr(self.stream, "close"):
                     self.stream.close()
-                StreamHandler.close(self)
                 self.stream = None
+            # Issue #19523: call unconditionally to
+            # prevent a handler leak when delay is set
+            StreamHandler.close(self)
         finally:
             self.release()
 
diff --git a/Misc/NEWS b/Misc/NEWS
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -12,6 +12,8 @@
 Library
 -------
 
+- Issue #19523: Closed FileHandler leak which occurred when delay was set.
+
 - Issue #1575020: Fixed support of 24-bit wave files on big-endian platforms.
 
 - Issue #19480: HTMLParser now accepts all valid start-tag names as defined

-- 
Repository URL: http://hg.python.org/cpython


More information about the Python-checkins mailing list