diff options
author | Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> | 2021-07-30 16:20:59 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-07-30 16:20:59 (GMT) |
commit | 6e6dc2517379289932c68fc986ee3994468374fc (patch) | |
tree | 4be4e2b192ca5877fcbab7d096146fa86046a80f | |
parent | c2e0b131c7d1db2e479908859ca9abded0c1b04e (diff) | |
download | cpython-6e6dc2517379289932c68fc986ee3994468374fc.zip cpython-6e6dc2517379289932c68fc986ee3994468374fc.tar.gz cpython-6e6dc2517379289932c68fc986ee3994468374fc.tar.bz2 |
bpo-44753: Don't use logfile extension when determining old files to be deleted (GH-27475) (GH-27487)
(cherry picked from commit 6ff890380971752299325bd28eab80ec936975cf)
-rw-r--r-- | Lib/logging/handlers.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/Lib/logging/handlers.py b/Lib/logging/handlers.py index 2a45f53..4cabc0d 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: |