summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorVinay Sajip <vinay_sajip@yahoo.co.uk>2011-01-21 23:35:57 (GMT)
committerVinay Sajip <vinay_sajip@yahoo.co.uk>2011-01-21 23:35:57 (GMT)
commiteb9d5ad6ba3153d2016d6708e1a3b63ea740e149 (patch)
tree54bf2a4a1320938da83f66b7160a2582d8011c52 /Lib
parenta970e6225885292974d266112cc39f350fdf979e (diff)
downloadcpython-eb9d5ad6ba3153d2016d6708e1a3b63ea740e149.zip
cpython-eb9d5ad6ba3153d2016d6708e1a3b63ea740e149.tar.gz
cpython-eb9d5ad6ba3153d2016d6708e1a3b63ea740e149.tar.bz2
Issue #10949: Improved robustness of rotating file handlers.
Diffstat (limited to 'Lib')
-rw-r--r--Lib/logging/handlers.py2
1 files changed, 2 insertions, 0 deletions
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: