]> granicus.if.org Git - python/commitdiff
Issue #10949: Improved robustness of rotating file handlers.
authorVinay Sajip <vinay_sajip@yahoo.co.uk>
Fri, 21 Jan 2011 23:35:57 +0000 (23:35 +0000)
committerVinay Sajip <vinay_sajip@yahoo.co.uk>
Fri, 21 Jan 2011 23:35:57 +0000 (23:35 +0000)
Lib/logging/handlers.py
Misc/NEWS

index 472eee5f6cc6e7b15303526bb62de9201513afe0..f8c7164bc187c372d4345733fc4e58c513a86050 100644 (file)
@@ -125,6 +125,7 @@ class RotatingFileHandler(BaseRotatingHandler):
         """
         if self.stream:
             self.stream.close()
+            self.stream = None
         if self.backupCount > 0:
             for i in range(self.backupCount - 1, 0, -1):
                 sfn = "%s.%d" % (self.baseFilename, i)
@@ -324,6 +325,7 @@ class TimedRotatingFileHandler(BaseRotatingHandler):
         """
         if self.stream:
             self.stream.close()
+            self.stream = None
         # get the time that this sequence started at and make it a TimeTuple
         t = self.rolloverAt - self.interval
         if self.utc:
index b9205de1f99a9bf5df274e59222c69706efc0b33..f77b60354e189ab6a249e739b10287f91e890fe7 100644 (file)
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -35,6 +35,8 @@ Core and Builtins
 Library
 -------
 
+- Issue #10949: Improved robustness of rotating file handlers.
+
 - Issue #10955: Fix a potential crash when trying to mmap() a file past its
   length.  Initial patch by Ross Lagerwall.