summaryrefslogtreecommitdiffstats
path: root/Lib/logging
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2024-03-16 10:29:42 (GMT)
committerGitHub <noreply@github.com>2024-03-16 10:29:42 (GMT)
commit269051d20e65eda30734cbbbdb07d21df61978d6 (patch)
tree071c5934c8d1b80819278efd401315960a65891a /Lib/logging
parent20578a1f68c841a264b72b00591b11ab2fa77b43 (diff)
downloadcpython-269051d20e65eda30734cbbbdb07d21df61978d6.zip
cpython-269051d20e65eda30734cbbbdb07d21df61978d6.tar.gz
cpython-269051d20e65eda30734cbbbdb07d21df61978d6.tar.bz2
gh-90535: Fix support of interval>1 in logging.TimedRotatingFileHandler (GH-116220)
Fix support of interval values > 1 in logging.TimedRotatingFileHandler for when='MIDNIGHT' and when='Wx'.
Diffstat (limited to 'Lib/logging')
-rw-r--r--Lib/logging/handlers.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/Lib/logging/handlers.py b/Lib/logging/handlers.py
index 30cfe06..410bd98 100644
--- a/Lib/logging/handlers.py
+++ b/Lib/logging/handlers.py
@@ -340,7 +340,10 @@ class TimedRotatingFileHandler(BaseRotatingHandler):
daysToWait = self.dayOfWeek - day
else:
daysToWait = 6 - day + self.dayOfWeek + 1
- result += daysToWait * (60 * 60 * 24)
+ result += daysToWait * _MIDNIGHT
+ result += self.interval - _MIDNIGHT * 7
+ else:
+ result += self.interval - _MIDNIGHT
if not self.utc:
dstNow = t[-1]
dstAtRollover = time.localtime(result)[-1]