]> 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 0d99f469f716bb5b10f3df19cff3363dda738c41..e9dac43f61ef39454dc645f69fe263d1811bb3ea 100644 (file)
@@ -114,6 +114,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)
@@ -313,6 +314,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 f6ed01d4e2735ddde36fac4da537d35bf136de72..4ab4c1cd6613a4b6741010e4ef48d02d2b8552ad 100644 (file)
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -37,6 +37,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.