]> git.ipfire.org Git - thirdparty/Python/cpython.git/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 96cdcc65e08d7f89983c7b234823fd39f23d251b..96384bd7f7ec67156fbbd3dadaae305b9dcf54ca 100644 (file)
@@ -120,6 +120,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)
@@ -316,6 +317,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 44d39cf71d1098c32bea9520ce9d8f36f64ee922..0ae7d7d8003049b8bf05d1f8125c28b502902a17 100644 (file)
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -16,6 +16,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.