Commit 4c02491f authored by Vinay Sajip's avatar Vinay Sajip

Closes #18940: Merged fix from 3.3.

parents facab9b4 117cf1c3
...@@ -109,7 +109,9 @@ class BaseRotatingHandler(logging.FileHandler): ...@@ -109,7 +109,9 @@ class BaseRotatingHandler(logging.FileHandler):
what the source is rotated to, e.g. 'test.log.1'. what the source is rotated to, e.g. 'test.log.1'.
""" """
if not callable(self.rotator): 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: else:
self.rotator(source, dest) 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