From eb9d5ad6ba3153d2016d6708e1a3b63ea740e149 Mon Sep 17 00:00:00 2001 From: Vinay Sajip Date: Fri, 21 Jan 2011 23:35:57 +0000 Subject: Issue #10949: Improved robustness of rotating file handlers. --- Lib/logging/handlers.py | 2 ++ Misc/NEWS | 2 ++ 2 files changed, 4 insertions(+) diff --git a/Lib/logging/handlers.py b/Lib/logging/handlers.py index 0d99f46..e9dac43 100644 --- a/Lib/logging/handlers.py +++ b/Lib/logging/handlers.py @@ -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: diff --git a/Misc/NEWS b/Misc/NEWS index f6ed01d..4ab4c1c 100644 --- 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. -- cgit v0.12