Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit eb9d5ad

Browse files
committed
Issue #10949: Improved robustness of rotating file handlers.
1 parent a970e62 commit eb9d5ad

2 files changed

Lines changed: 4 additions & 0 deletions

File tree

Lib/logging/handlers.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,7 @@ def doRollover(self):
114114
"""
115115
if self.stream:
116116
self.stream.close()
117+
self.stream = None
117118
if self.backupCount > 0:
118119
for i in range(self.backupCount - 1, 0, -1):
119120
sfn = "%s.%d" % (self.baseFilename, i)
@@ -313,6 +314,7 @@ def doRollover(self):
313314
"""
314315
if self.stream:
315316
self.stream.close()
317+
self.stream = None
316318
# get the time that this sequence started at and make it a TimeTuple
317319
t = self.rolloverAt - self.interval
318320
if self.utc:

Misc/NEWS

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,8 @@ Core and Builtins
3737
Library
3838
-------
3939

40+
- Issue #10949: Improved robustness of rotating file handlers.
41+
4042
- Issue #10955: Fix a potential crash when trying to mmap() a file past its
4143
length. Initial patch by Ross Lagerwall.
4244

0 commit comments

Comments
 (0)