[New-bugs-announce] [issue23305] RotatingFileHandler does not rotate if backupCount is 0

Juha Lemmetti report at bugs.python.org
Fri Jan 23 11:37:03 CET 2015


New submission from Juha Lemmetti:

If RotatingFileHandler is initialized with backupCount 0, the file does not rotate but grows indefinitely. This is not self-evident from the documentation.

Suggestion: either rotate (discard) the log if backupCount==0 or mention the current operation the documentation. The former leaves the user with only one log message at the worst case. 

In the latter case, the documentation can be modified to explicitly mention what the result will be if backupCount is left to its default value of 0, i.e. that the RotatingFileHandler will grow the file indefinitely regardless of the value of maxBytes value. The default value for the backupCount could also be modified, as the default value does nothing.

Tested with Windows-Python2.7, Linux-Python 3.3.2+ (Ubuntu-14.04). Can be reproduced with a simple logging example with backupCount == 0 and maxBytes > 0

----------
components: Library (Lib)
messages: 234552
nosy: Juha.Lemmetti, vinay.sajip
priority: normal
severity: normal
status: open
title: RotatingFileHandler does not rotate if backupCount is 0
type: enhancement
versions: Python 2.7, Python 3.3, Python 3.4

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


More information about the New-bugs-announce mailing list