                     "probably a bug which should be fixed:\n{}".format(traceback.format_exc()))
      with open(filename, "w") as outfile:
          outfile.writelines(freeze_log)
          outfile.write(original_traceback)
          outfile.write(sysinfo)
      return filename
  
  
  _OLD_FACTORY = logging.getLogRecordFactory()
  
 
</s> remove     with open(filename, "w") as outfile:
 </s> add     with open(filename, "wb") as outfile: </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     log_file = RotatingFileHandler(filename, backupCount=1)
 </s> add     log_file = RotatingFileHandler(filename, backupCount=1, encoding="utf-8") </s> remove             self.append(line + "\n")
 </s> add             self.append(f"{line}\n")
        outfile.write(sysinfo.encode("utf-8"))
                     "probably a bug which should be fixed:\n{}".format(traceback.format_exc()))
      with open(filename, "w") as outfile:
          outfile.writelines(freeze_log)
          outfile.write(original_traceback)
        outfile.write(sysinfo.encode("utf-8"))
      return filename
  
  
  _OLD_FACTORY = logging.getLogRecordFactory()
  
keep keep keep keep replace keep keep keep keep keep
 Bugfix - lib.logger - Force file writing to urf-8 
lib/logger.py