          buffer: str
              The log messages to write to the rolling buffer
          """
          for line in buffer.rstrip().splitlines():
              self.append(line + "\n")
  
  
  class TqdmHandler(logging.StreamHandler):
      """ Overrides :class:`logging.StreamHandler` to use :func:`tqdm.tqdm.write` rather than writing
      to :func:`sys.stderr` so that log messages do not mess up tqdm progress bars. """
 
</s> remove     log_file = RotatingFileHandler(filename, backupCount=1)
 </s> add     log_file = RotatingFileHandler(filename, backupCount=1, encoding="utf-8") </s> remove     original_traceback = traceback.format_exc()
 </s> add     original_traceback = traceback.format_exc().encode("utf-8") </s> remove     freeze_log = list(_DEBUG_BUFFER)
 </s> add     freeze_log = [line.encode("utf-8") for line in _DEBUG_BUFFER] </s> remove         outfile.write(sysinfo)
 </s> add         outfile.write(sysinfo.encode("utf-8")) </s> remove     with open(filename, "w") as outfile:
 </s> add     with open(filename, "wb") as outfile:
            self.append(f"{line}\n")
          buffer: str
              The log messages to write to the rolling buffer
          """
          for line in buffer.rstrip().splitlines():
            self.append(f"{line}\n")
  
  
  class TqdmHandler(logging.StreamHandler):
      """ Overrides :class:`logging.StreamHandler` to use :func:`tqdm.tqdm.write` rather than writing
      to :func:`sys.stderr` so that log messages do not mess up tqdm progress bars. """
keep keep keep keep replace keep keep keep keep keep
 Bugfix - lib.logger - Force file writing to urf-8 
lib/logger.py