From: Vinay Sajip Date: Thu, 8 Jul 2004 10:24:04 +0000 (+0000) Subject: Add exception handling for BaseRotatingFileHandler (SF #979252) X-Git-Tag: v2.4a1~1 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=3970c11157e985966744cea2960964f5a3144f53;p=thirdparty%2FPython%2Fcpython.git Add exception handling for BaseRotatingFileHandler (SF #979252) --- diff --git a/Lib/logging/handlers.py b/Lib/logging/handlers.py index d1e0a91716b2..718c04d541d7 100644 --- a/Lib/logging/handlers.py +++ b/Lib/logging/handlers.py @@ -58,9 +58,12 @@ class BaseRotatingHandler(logging.FileHandler): Output the record to the file, catering for rollover as described in doRollover(). """ - if self.shouldRollover(record): - self.doRollover() - logging.FileHandler.emit(self, record) + try: + if self.shouldRollover(record): + self.doRollover() + logging.FileHandler.emit(self, record) + except: + self.handleError(record) class RotatingFileHandler(BaseRotatingHandler): """