Skip to content

Commit

Permalink
Add UTF-8 encoding argument to logger and csv file
Browse files Browse the repository at this point in the history
  • Loading branch information
Jasper-Harvey0 committed Nov 18, 2024
1 parent 37e7652 commit 8daa5b5
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/fixate/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -410,7 +410,7 @@ def run_main_program(test_script_path=None, main_args=None):
args.diagnostic_log_dir.mkdir(parents=True, exist_ok=True)

handler = RotateEachInstanceHandler(
args.diagnostic_log_dir / "fixate.log", backupCount=10
args.diagnostic_log_dir / "fixate.log", backupCount=10, encoding='utf-8'
)
handler.setFormatter(
logging.Formatter("%(asctime)s - %(name)s - %(levelname)s - %(message)s")
Expand Down
2 changes: 1 addition & 1 deletion src/fixate/reporting/csv.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ def _csv_write(self, cmd_q):
os.makedirs(os.path.dirname(self.reporting.csv_path))
except OSError as e:
pass
with open(self.reporting.csv_path, "a+", newline="") as f:
with open(self.reporting.csv_path, "a+", newline="", encoding="utf-8") as f:
writer = csv.writer(f, quoting=csv.QUOTE_MINIMAL)
writer.writerow(line)

Expand Down

0 comments on commit 8daa5b5

Please sign in to comment.