diff options
author | Vinay Sajip <vinay_sajip@yahoo.co.uk> | 2013-09-06 09:10:22 (GMT) |
---|---|---|
committer | Vinay Sajip <vinay_sajip@yahoo.co.uk> | 2013-09-06 09:10:22 (GMT) |
commit | d859926b298516402a1e8b963cf62e568f0eb848 (patch) | |
tree | 4871178dd74df357d1fb01b10ed95f83e34f0ae7 /Lib | |
parent | a704582002ac621080cdbbfbe46eb7faf3393313 (diff) | |
download | cpython-d859926b298516402a1e8b963cf62e568f0eb848.zip cpython-d859926b298516402a1e8b963cf62e568f0eb848.tar.gz cpython-d859926b298516402a1e8b963cf62e568f0eb848.tar.bz2 |
Issue #18940: Handled low-volume logging when delay is True.
Diffstat (limited to 'Lib')
-rw-r--r-- | Lib/logging/handlers.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/Lib/logging/handlers.py b/Lib/logging/handlers.py index 93aa50e..f0f634e 100644 --- a/Lib/logging/handlers.py +++ b/Lib/logging/handlers.py @@ -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) |