Skip to content

Commit

Permalink
bpo-44753: Don't use logfile extension when determining old files to …
Browse files Browse the repository at this point in the history
…be deleted (GH-27475) (GH-27486)

(cherry picked from commit 6ff8903)
  • Loading branch information
miss-islington authored Jul 30, 2021
1 parent 3a806b1 commit 882e476
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Lib/logging/handlers.py
Original file line number Diff line number Diff line change
Expand Up @@ -356,7 +356,8 @@ def getFilesToDelete(self):
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:
Expand Down

0 comments on commit 882e476

Please sign in to comment.