Commit 117cf1c3 authored by Vinay Sajip's avatar Vinay Sajip

Issue #18940: Handled low-volume logging when delay is True.

parent ed8b13bb
......@@ -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)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment