summaryrefslogtreecommitdiffstats
path: root/Lib/logging
diff options
context:
space:
mode:
authorVinay Sajip <vinay_sajip@yahoo.co.uk>2021-07-30 11:48:50 (GMT)
committerGitHub <noreply@github.com>2021-07-30 11:48:50 (GMT)
commit6ff890380971752299325bd28eab80ec936975cf (patch)
tree4bdaa0e0fa8a225c17abc118b3f8ee96b13251a1 /Lib/logging
parentaaa83cdfab6817446285e631232f64b394ac6791 (diff)
downloadcpython-6ff890380971752299325bd28eab80ec936975cf.zip
cpython-6ff890380971752299325bd28eab80ec936975cf.tar.gz
cpython-6ff890380971752299325bd28eab80ec936975cf.tar.bz2
bpo-44753: Don't use logfile extension when determining old files to be deleted (GH-27475)
Diffstat (limited to 'Lib/logging')
-rw-r--r--Lib/logging/handlers.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/Lib/logging/handlers.py b/Lib/logging/handlers.py
index 9506b9a..e2579db 100644
--- a/Lib/logging/handlers.py
+++ b/Lib/logging/handlers.py
@@ -359,7 +359,8 @@ class TimedRotatingFileHandler(BaseRotatingHandler):
dirName, baseName = os.path.split(self.baseFilename)
fileNames = os.listdir(dirName)
result = []
- prefix = baseName + "."
+ # See bpo-44753: Don't use the extension when computing the prefix.
+ prefix = os.path.splitext(baseName)[0] + "."
plen = len(prefix)
for fileName in fileNames:
if fileName[:plen] == prefix: