summaryrefslogtreecommitdiffstats
path: root/Lib/logging/handlers.py
diff options
context:
space:
mode:
authorVinay Sajip <vinay_sajip@yahoo.co.uk>2016-07-22 17:23:04 (GMT)
committerVinay Sajip <vinay_sajip@yahoo.co.uk>2016-07-22 17:23:04 (GMT)
commit638e6220557db50b01653b410eb12f11b9b8ab1c (patch)
treeb685830fe324decdb9c7a5dc68abb31ccd32c617 /Lib/logging/handlers.py
parentd3afb62b8fb38417c3f0bf6873ed64bd9efd8e43 (diff)
downloadcpython-638e6220557db50b01653b410eb12f11b9b8ab1c.zip
cpython-638e6220557db50b01653b410eb12f11b9b8ab1c.tar.gz
cpython-638e6220557db50b01653b410eb12f11b9b8ab1c.tar.bz2
Closes #27493: accepted Path objects in file handlers for logging.
Diffstat (limited to 'Lib/logging/handlers.py')
-rw-r--r--Lib/logging/handlers.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/Lib/logging/handlers.py b/Lib/logging/handlers.py
index 296d6cf..ba00a69 100644
--- a/Lib/logging/handlers.py
+++ b/Lib/logging/handlers.py
@@ -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: