[issue46377] TimedRotatingFileHandler "midnight" misleading when interval > 1

2022-01-14 Thread Mike Schiessl


Mike Schiessl  added the comment:

Yes, enforcing interval == 1 or interval == None (which pulls the 
TimedRotatingFileHandler class __init__ default value which is also 1) works 
perfectly with midnight.

I do not see any urge on that topic - as I personally now know the issue :D - 
but I really feel this fix could save someones else's time someday ;) 

So going the "safe" way via deprecation cycle seems to be the right approach

--

___
Python tracker 
<https://bugs.python.org/issue46377>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46377] TimedRotatingFileHandler "midnight" misleading when interval > 1

2022-01-14 Thread Mike Schiessl


Mike Schiessl  added the comment:

i've just checked PR and you're right, something with the PR went wrong.

Anyway, midnight (at least from the wording) specifies the "atTime". (which 
should be midnight). 


Again, if there's (by mistake) an interval bigger than 1 set(which in my mind 
makes no sense along to be used with midnight) things are getting pretty 
intransparent. The midnight handler created a logfile dated with 2021-12-15 
(last night). Took me some time to get this sorted. (I've discovered, that I've 
set 30 in a default value file).

Agreed on the backward compatibility, but I would assume someone using 
"midnight" would not expect any other behavior than "daily at midnight" besides 
using the atTime to modify the rollover time. (my opinion)

--

___
Python tracker 
<https://bugs.python.org/issue46377>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46377] TimedRotatingFileHandler "midnight" misleading when interval > 1

2022-01-14 Thread Mike Schiessl


New submission from Mike Schiessl :

Using the TimedRotatingFileHandler along with "when='midnight'" and interval > 
1, midnight is handled equally to "days" which is a little misleading.

Expectation:
setting when to 'midnight', the file is rotated every midnight (interval value 
should be ignored)

Current behavior:
If 'midnight' is given alongside with an interval greater than 1 (.e.g 5), the 
(internal) interval (24*60*60) is calculated with the given interval -> 
24*60*60 * 5.


In my case, this led to some unforeseeable and unexpected behavior.

--
components: Library (Lib)
messages: 410558
nosy: mschiess, vinay.sajip
priority: normal
severity: normal
status: open
title: TimedRotatingFileHandler "midnight" misleading when interval > 1
type: behavior
versions: Python 3.10, Python 3.11, Python 3.7, Python 3.8, Python 3.9

___
Python tracker 
<https://bugs.python.org/issue46377>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com