mirror of https://github.com/python/cpython
Issue #10949: Improved robustness of rotating file handlers.
This commit is contained in:
parent
8a0eede21d
commit
cdb8388cad
|
@ -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:
|
||||
|
|
Loading…
Reference in New Issue