mirror of
https://github.com/python/cpython.git
synced 2025-12-15 21:44:50 +00:00
Closes #18940: Merged fix from 3.3.
This commit is contained in:
commit
a92a3564a9
1 changed files with 3 additions and 1 deletions
|
|
@ -109,7 +109,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