bpo-44753: Don't use logfile extension when determining old files to be deleted (GH-27475)

This commit is contained in:
Vinay Sajip 2021-07-30 12:48:50 +01:00 committed by GitHub
parent aaa83cdfab
commit 6ff8903809
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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: