This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: RotatingFileHandler and TimedRotatingFileHandler do not respect delay on rollover
Type: Stage: resolved
Components: Versions:
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: python-dev, solarmist, vinay.sajip
Priority: normal Keywords: patch

Created on 2013-09-05 23:56 by solarmist, last changed 2022-04-11 14:57 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
logging_test.py solarmist, 2013-09-06 01:56 Code to demonstrate the bug
delay_rollover.patch solarmist, 2013-09-06 01:56 Patch for rolling over with delay set
Messages (4)
msg197036 - (view) Author: Joshua Olson (solarmist) * Date: 2013-09-05 23:56
For low volume loggers RotatingFileHandler and TimedRotatingFileHandler will create possibly unnecessary files on doRollover, since they don't check the value of delay when opening the new self.stream.

self.stream = self._open()

should be something like

if not self.delay:
    self.stream = self._open()
msg197042 - (view) Author: Joshua Olson (solarmist) * Date: 2013-09-06 01:56
Demonstrate the bug
msg197043 - (view) Author: Joshua Olson (solarmist) * Date: 2013-09-06 01:56
If delay is set then don't automatically open the new file.
msg197061 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2013-09-06 09:27
New changeset 4d45f1ed1179 by Vinay Sajip in branch '2.7':
Issue #18941: Respected delay when doing rollover.
http://hg.python.org/cpython/rev/4d45f1ed1179

New changeset 0577c9a82c0a by Vinay Sajip in branch '3.3':
Issue #18941: Respected delay when doing rollover.
http://hg.python.org/cpython/rev/0577c9a82c0a

New changeset 7627fea85a6d by Vinay Sajip in branch 'default':
Closes #18941: Merged fix from 3.3.
http://hg.python.org/cpython/rev/7627fea85a6d
History
Date User Action Args
2022-04-11 14:57:50adminsetgithub: 63141
2013-09-06 09:27:03python-devsetstatus: open -> closed

nosy: + python-dev
messages: + msg197061

resolution: fixed
stage: resolved
2013-09-06 02:43:00r.david.murraysetnosy: + vinay.sajip
2013-09-06 01:56:46solarmistsetfiles: + delay_rollover.patch
keywords: + patch
messages: + msg197043
2013-09-06 01:56:06solarmistsetfiles: + logging_test.py

messages: + msg197042
2013-09-05 23:56:08solarmistcreate