Commits

Felix Krull committed 160a13d

Swallow logging exceptions.

  • Participants
  • Parent commits 66bad85

Comments (0)

Files changed (2)

File provence/core/cmdline.py

     logfile_handler = logging.FileHandler(options.log_file, mode="w",
                                           encoding="utf-8")
     root_logger.addHandler(logfile_handler)
+    logging.raiseExceptions = False
 
 
 def main():

File provence/tests/test_cmdline.py

         opts = mock.Mock(log_file=self.temp_name)
         cmdline._configure_logging(opts)
         register_mock.assert_called_once_with(logging.shutdown)
+        self.assertFalse(logging.raiseExceptions)
 
     def test_high_unicode_message(self):
         opts = mock.Mock(log_file=self.temp_name)
         cmdline._configure_logging(opts)
+        # Undo this change so this test actually fails when an error occurs.
+        logging.raiseExceptions = True
         logging.info("test äöü".encode("latin1")
                      .decode("utf-8", errors="replace"))
         self.assert_stdout_equal("")