diff options
author | Vinay Sajip <vinay_sajip@yahoo.co.uk> | 2004-07-08 10:24:04 +0000 |
---|---|---|
committer | Vinay Sajip <vinay_sajip@yahoo.co.uk> | 2004-07-08 10:24:04 +0000 |
commit | 3970c11157e985966744cea2960964f5a3144f53 (patch) | |
tree | e339afe5ad4b2c9bba7a591cb89ac4b1d4203630 /Lib/logging/handlers.py | |
parent | 4bbab2bde4fa7df27d9b9f04793d53d4754e22b4 (diff) | |
download | cpython-git-3970c11157e985966744cea2960964f5a3144f53.tar.gz |
Add exception handling for BaseRotatingFileHandler (SF #979252)
Diffstat (limited to 'Lib/logging/handlers.py')
-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 d1e0a91716..718c04d541 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): """ |