Closes #27493: accepted Path objects in file handlers for logging.

This commit is contained in:
Vinay Sajip 2016-07-22 18:23:04 +01:00
parent d3afb62b8f
commit 638e622055
4 changed files with 44 additions and 2 deletions

View file

@ -246,6 +246,9 @@ class TimedRotatingFileHandler(BaseRotatingHandler):
self.extMatch = re.compile(self.extMatch, re.ASCII)
self.interval = self.interval * interval # multiply by units requested
# The following line added because the filename passed in could be a
# path object (see Issue #27493), but self.baseFilename will be a string
filename = self.baseFilename
if os.path.exists(filename):
t = os.stat(filename)[ST_MTIME]
else: