[New-bugs-announce] [issue43344] RotatingFileHandler breaks file type associations

Kevin Hollingshead report at bugs.python.org
Sat Feb 27 17:44:17 EST 2021

New submission from Kevin Hollingshead <kh14821 at gmail.com>:

The filenames generated by logging.RotatingFileHandler breaks the ability to associate a program (e.g. notepad++, sublime text, etc.) with the log files using Windows or OSX file associations because the extension is overridden by the added suffix. For example, if I specify the filename as "test.log" for a TimeBasedRotatingFileHandler with a suffix of "%Y%m%d", rolled over files are named test.log.YYYYMMDD. There is no way to associate a program with this type of file extension. A good non-breaking fix would be to add a parameter "extension" to RotatingFileHandler, and if specified would be applied to all filenames. Thus if I specify filename="test" and "extension="log" for my handler it would give "test.log" for the initial file and "test.YYYYMMDD.log" for rollover files.

components: Extension Modules
files: logger_bug.py
messages: 387793
nosy: kh14821
priority: normal
severity: normal
status: open
title: RotatingFileHandler breaks file type associations
type: behavior
Added file: https://bugs.python.org/file49840/logger_bug.py

Python tracker <report at bugs.python.org>

More information about the New-bugs-announce mailing list