When creating a logging.handlers.TimedRotatingFileHandler object, an exception is raised complaining ST_MTIME is not defined if a logfile with the same name already exists. Reproducible: Always Steps to Reproduce: 1. Create file 'mylog.log'. 2. Create python script that creates an instance of logging.handlers.TimedRotatingFileHandler('myFile.log', 'D') 3. Run script Actual Results: An exception is raised: File "/usr/lib64/python3.1/logging/handlers.py" line 206, in __init__ t = os.stat(filename)[ST_MTIME] NameError: global name 'ST_MTIME' is not defined. I checked the upstream version of this file at svn.python.org. This issue seems to be fixed by the maintainer somewhere in march 2010.
Fixed in 3.1.3-r1.