1. Armin Rigo
  2. cpython-withatomic

Commits

Vinay Sajip  committed 9288d52

Add exception handling for BaseRotatingFileHandler (SF #979252)

  • Participants
  • Parent commits d42749d
  • Branches legacy-trunk

Comments (0)

Files changed (1)

File Lib/logging/handlers.py

View file
  • Ignore whitespace
         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):
     """