[New-bugs-announce] [issue18940] TimedRotatingFileHandler fails to doRollover if a logger has delay=True and no logs in that time.

Joshua Olson report at bugs.python.org
Fri Sep 6 01:49:27 CEST 2013


New submission from Joshua Olson:

In TimedRotatingFileHandler if you have a low volume logger than hasn't written to the log within the interval time doRollover will fail because there is no file to rotate.

os.rename(self.baseFilename, dfn) 

should be something like

if os.path.exists(self.base_fileName):
    os.rename(self.baseFilename, dfn

I have included a unit test file.  This test fails on 2.7.1 and 2.7.3. I have not tried 2.7.5.

----------
components: Library (Lib)
files: logging_test.py
messages: 197035
nosy: solarmist
priority: normal
severity: normal
status: open
title: TimedRotatingFileHandler fails to doRollover if a logger has delay=True and no logs in that time.
versions: Python 2.7
Added file: http://bugs.python.org/file31620/logging_test.py

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue18940>
_______________________________________


More information about the New-bugs-announce mailing list