Removed buggy exception handling in doRollover of rotating file handlers. Exceptions now propagate to caller.

This commit is contained in:
Vinay Sajip 2006-06-27 07:34:37 +00:00
parent c315a0fa40
commit 6dd59f1632
1 changed files with 2 additions and 12 deletions

View File

@ -128,12 +128,7 @@ class RotatingFileHandler(BaseRotatingHandler):
dfn = self.baseFilename + ".1"
if os.path.exists(dfn):
os.remove(dfn)
try:
os.rename(self.baseFilename, dfn)
except (KeyboardInterrupt, SystemExit):
raise
except:
self.handleError(record)
os.rename(self.baseFilename, dfn)
#print "%s -> %s" % (self.baseFilename, dfn)
if self.encoding:
self.stream = codecs.open(self.baseFilename, 'w', self.encoding)
@ -273,12 +268,7 @@ class TimedRotatingFileHandler(BaseRotatingHandler):
dfn = self.baseFilename + "." + time.strftime(self.suffix, timeTuple)
if os.path.exists(dfn):
os.remove(dfn)
try:
os.rename(self.baseFilename, dfn)
except (KeyboardInterrupt, SystemExit):
raise
except:
self.handleError(record)
os.rename(self.baseFilename, dfn)
if self.backupCount > 0:
# find the oldest log file and delete it
s = glob.glob(self.baseFilename + ".20*")