diff options
author | Vinay Sajip <vinay_sajip@yahoo.co.uk> | 2021-07-30 11:48:50 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-07-30 11:48:50 (GMT) |
commit | 6ff890380971752299325bd28eab80ec936975cf (patch) | |
tree | 4bdaa0e0fa8a225c17abc118b3f8ee96b13251a1 /Lib/logging/handlers.py | |
parent | aaa83cdfab6817446285e631232f64b394ac6791 (diff) | |
download | cpython-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/handlers.py')
-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 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: |