classification
Title: TimedRotatingFileHandler logic for day of week is wrong
Type: behavior Stage:
Components: None Versions: Python 2.4
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: vinay.sajip Nosy List: mosheco, vinay.sajip
Priority: normal Keywords:

Created on 2007-10-24 08:18 by mosheco, last changed 2007-10-24 10:54 by vinay.sajip. This issue is now closed.

Messages (3)
msg56702 - (view) Author: Moshe Cohen (mosheco) Date: 2007-10-24 08:21
The logic for determining the time till midnight on the requested day of
week is reversed.
From logging/handlers.py:234 

                if day > self.dayOfWeek:
                    daysToWait = (day - self.dayOfWeek) - 1
                    self.rolloverAt = self.rolloverAt + (daysToWait *
(60 * 60 * 24))
                if day < self.dayOfWeek:
                    daysToWait = (6 - self.dayOfWeek) + day
                    self.rolloverAt = self.rolloverAt + (daysToWait *
(60 * 60 * 24))

The two cases are reversed. 'day' is the current day. 'self.dayOfWeek'
is the desired day.
msg56703 - (view) Author: Moshe Cohen (mosheco) Date: 2007-10-24 08:22
The comments before the code are correct, by the way.
The code should do exactly that.
msg56705 - (view) Author: Vinay Sajip (vinay.sajip) * (Python committer) Date: 2007-10-24 10:54
Fixed checked into trunk: r58628. Also checked into release25-maint.
History
Date User Action Args
2007-10-24 10:54:05vinay.sajipsetstatus: open -> closed
resolution: fixed
messages: + msg56705
2007-10-24 08:54:34georg.brandlsetassignee: vinay.sajip
nosy: + vinay.sajip
2007-10-24 08:22:59moshecosetmessages: + msg56703
2007-10-24 08:21:32moshecosetmessages: + msg56702
2007-10-24 08:18:16moshecocreate