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 <rep...@bugs.python.org>
<http://bugs.python.org/issue23305>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to