From: Vinay Sajip Date: Fri, 6 Sep 2013 09:10:22 +0000 (+0100) Subject: Issue #18940: Handled low-volume logging when delay is True. X-Git-Tag: v3.4.0a2~16^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=d859926b298516402a1e8b963cf62e568f0eb848;p=thirdparty%2FPython%2Fcpython.git Issue #18940: Handled low-volume logging when delay is True. --- diff --git a/Lib/logging/handlers.py b/Lib/logging/handlers.py index 93aa50ea832c..f0f634e8d38f 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)