mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
[3.9] bpo-45628: Check all parts of the suffix for an extension match. (GH-29310) (GH-29313)
This commit is contained in:
parent
a043706f90
commit
317e0c99e3
1 changed files with 7 additions and 2 deletions
|
@ -368,8 +368,13 @@ class TimedRotatingFileHandler(BaseRotatingHandler):
|
|||
for fileName in fileNames:
|
||||
if fileName[:plen] == prefix:
|
||||
suffix = fileName[plen:]
|
||||
if self.extMatch.match(suffix):
|
||||
result.append(os.path.join(dirName, fileName))
|
||||
# See bpo-45628: The date/time suffix could be anywhere in the
|
||||
# filename
|
||||
parts = suffix.split('.')
|
||||
for part in parts:
|
||||
if self.extMatch.match(part):
|
||||
result.append(os.path.join(dirName, fileName))
|
||||
break
|
||||
if len(result) < self.backupCount:
|
||||
result = []
|
||||
else:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue