[Python-checkins] cpython (merge 3.3 -> default): Closes #18940: Merged fix from 3.3.

vinay.sajip python-checkins at python.org
Fri Sep 6 11:11:54 CEST 2013


http://hg.python.org/cpython/rev/8002aee72837
changeset:   85565:8002aee72837
parent:      85562:408b6b3dcf9a
parent:      85564:324774a59256
user:        Vinay Sajip <vinay_sajip at yahoo.co.uk>
date:        Fri Sep 06 10:11:37 2013 +0100
summary:
  Closes #18940: Merged fix from 3.3.

files:
  Lib/logging/handlers.py |  4 +++-
  1 files changed, 3 insertions(+), 1 deletions(-)


diff --git a/Lib/logging/handlers.py b/Lib/logging/handlers.py
--- a/Lib/logging/handlers.py
+++ b/Lib/logging/handlers.py
@@ -109,7 +109,9 @@
                        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)
 

-- 
Repository URL: http://hg.python.org/cpython


More information about the Python-checkins mailing list