mirror of
https://github.com/python/cpython
synced 2026-09-29 11:35:29 +03:00
Issue #18940: Handled low-volume logging when delay is True.
This commit is contained in:
parent
a704582002
commit
d859926b29
1 changed files with 3 additions and 1 deletions
|
|
@ -111,7 +111,9 @@ class BaseRotatingHandler(logging.FileHandler):
|
|||
what the source is rotated to, e.g. 'test.log.1'.
|
||||
"""
|
||||
if not callable(self.rotator):
|
||||
os.rename(source, dest)
|
||||
# Issue 18940: A file may not have been created if delay is True.
|
||||
if os.path.exists(source):
|
||||
os.rename(source, dest)
|
||||
else:
|
||||
self.rotator(source, dest)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue