[issue1321] TimedRotatingFileHandler logic for day of week is wrong
Changes by Moshe Cohen: -- components: None nosy: mosheco severity: major status: open title: TimedRotatingFileHandler logic for day of week is wrong type: behavior versions: Python 2.4 __ Tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue1321> __ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1321] TimedRotatingFileHandler logic for day of week is wrong
New submission from Moshe Cohen: 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. __ Tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue1321> __ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1321] TimedRotatingFileHandler logic for day of week is wrong
Moshe Cohen added the comment: The comments before the code are correct, by the way. The code should do exactly that. __ Tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue1321> __ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com