[issue9512] logging.handlers.RotatingFileHandler - mode argument not respected

Terry J. Reedy report at bugs.python.org
Thu Aug 5 01:28:54 CEST 2010


Terry J. Reedy <tjreedy at udel.edu> added the comment:

I presume your report is about the fact that the mode is 'a' even though you specified 'a+'. The answer is this block from RotatingFileHandler.__init__ (3.1.2, but presume same for 2.x):

       if maxBytes > 0:
            mode = 'a' # doesn't make sense otherwise!

I do not understand the comment, but there it is. So

DOC PATCH In 15.6.12.5. RotatingFileHandler, replace
"If mode is not specified, 'a' is used." with
"If mode is not specified or if maxBytes > 0, the mode is 'a'."

----------
assignee:  -> docs at python
components: +Documentation -Library (Lib)
keywords: +easy, patch
nosy: +docs at python, terry.reedy
versions: +Python 3.1, Python 3.2 -Python 2.5, Python 2.6

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


More information about the Python-bugs-list mailing list