]> granicus.if.org Git - python/commitdiff
Issue #19523: Closed FileHandler leak which occurred when delay was set.
authorVinay Sajip <vinay_sajip@yahoo.co.uk>
Fri, 15 Nov 2013 20:39:33 +0000 (20:39 +0000)
committerVinay Sajip <vinay_sajip@yahoo.co.uk>
Fri, 15 Nov 2013 20:39:33 +0000 (20:39 +0000)
Lib/logging/__init__.py
Misc/NEWS

index cda781a4896feab5cd169e72db08536219d2965f..9548e2246383dbde0ca13650887df3bf83f63707 100644 (file)
@@ -912,8 +912,10 @@ class FileHandler(StreamHandler):
                 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()
 
index f60af40c2f3a7c39a0836f8cb2e635bf3c769063..2638fc766e5488ce24ca1665021b22ed83a7eeaa 100644 (file)
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -12,6 +12,8 @@ Core and Builtins
 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