diff options
author | Vinay Sajip <vinay_sajip@yahoo.co.uk> | 2004-07-08 10:24:04 (GMT) |
---|---|---|
committer | Vinay Sajip <vinay_sajip@yahoo.co.uk> | 2004-07-08 10:24:04 (GMT) |
commit | 3970c11157e985966744cea2960964f5a3144f53 (patch) | |
tree | e339afe5ad4b2c9bba7a591cb89ac4b1d4203630 | |
parent | 4bbab2bde4fa7df27d9b9f04793d53d4754e22b4 (diff) | |
download | cpython-3970c11157e985966744cea2960964f5a3144f53.zip cpython-3970c11157e985966744cea2960964f5a3144f53.tar.gz cpython-3970c11157e985966744cea2960964f5a3144f53.tar.bz2 |
Add exception handling for BaseRotatingFileHandler (SF #979252)
-rw-r--r-- | Lib/logging/handlers.py | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/Lib/logging/handlers.py b/Lib/logging/handlers.py index d1e0a91..718c04d 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): """ |