]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Issue #19523: Closed FileHandler leak which occurred when delay was set.
authorVinay Sajip <vinay_sajip@yahoo.co.uk>
Fri, 15 Nov 2013 20:40:27 +0000 (20:40 +0000)
committerVinay Sajip <vinay_sajip@yahoo.co.uk>
Fri, 15 Nov 2013 20:40:27 +0000 (20:40 +0000)
Lib/logging/__init__.py
Misc/NEWS

index 4cef66fa139ea72823329c9a50e509990c65725a..7f94e39f0f523d94d1da97d91e3c54c7a714daed 100644 (file)
@@ -976,8 +976,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 9f99095924b8e6a28787df8e6a4abff1da7f8a30..d5d0637fb49ec896b1f0e1406f2ee67c07be01c6 100644 (file)
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -13,6 +13,8 @@ Core and Builtins
 Library
 -------
 
+- Issue #19523: Closed FileHandler leak which occurred when delay was set.
+
 - Issue #13674: Prevented time.strftime from crashing on Windows when given
   a year before 1900 and a format of %y.