From: Vinay Sajip Date: Fri, 21 Jan 2011 23:35:57 +0000 (+0000) Subject: Issue #10949: Improved robustness of rotating file handlers. X-Git-Tag: v2.7.2rc1~352 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=cdb8388cad74e0f2910d5b43531daf6271467292;p=thirdparty%2FPython%2Fcpython.git Issue #10949: Improved robustness of rotating file handlers. --- diff --git a/Lib/logging/handlers.py b/Lib/logging/handlers.py index 472eee5f6cc6..f8c7164bc187 100644 --- a/Lib/logging/handlers.py +++ b/Lib/logging/handlers.py @@ -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: diff --git a/Misc/NEWS b/Misc/NEWS index b9205de1f99a..f77b60354e18 100644 --- 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.