code: def save_journal(self):
          
          if self.journal_file is None:
              return
  
          try:
              as_text = self._commands_to_text()
              with open(self.journal_file, "w") as file_obj:
                  file_obj.write(as_text)
          except Exception as exc:
              msg = BAD_JOURNAL.format(exc)
              print(msg, file=sys.stderr)
docs: Save journaled commands to file.
  
          If there is no active journal, does nothing.
  
          If saving the commands to a file fails, a message will be printed to
          STDERR but the failure will be swallowed so that the extension can
          be built successfully.