New submission from Eric Govatos <eric.lucas.gova...@rockwellcollins.com>:

The RotatingFileHandler class located within lib/logging/handlers.py  does not 
accept any other 'mode' value than its default value of 'a' - even when the 
parameter is supplied, such as 'ab', to append bytes, this is disregarded and 
the mode is set back to 'a' if the maxBytes variable is greater than 0. 

While the reasoning behind this does make sense as the rotating file handler 
should only be appending data to files, this means that supplying a mode to 
append bytes is not supported. You can currently get around this by supplying 
the mode after constructing the handler.

Proposed solution would be to remove lines 146 and 147 from the class entirely 
and let the user decide on the file mode themselves.

----------
components: Library (Lib)
messages: 363957
nosy: elgovatos
priority: normal
severity: normal
status: open
title: RotatingFileHandler does not support any other mode than 'a'.
type: behavior
versions: Python 3.8

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue39938>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to