From d5d37952c9efb49e006f97637aa2f9354ff9937b Mon Sep 17 00:00:00 2001 From: Anand G <34826965+anandgsaga@users.noreply.github.com> Date: Sun, 8 Mar 2026 19:28:57 +0530 Subject: [PATCH] Use UTF-8 when opening log and report files Add encoding="utf-8" to file opens in cli/main.py (log file writes and report markdown writes) to ensure consistent UTF-8 output and avoid encoding errors on systems with different default encodings. --- cli/main.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cli/main.py b/cli/main.py index 02a6bbb4..c6047660 100644 --- a/cli/main.py +++ b/cli/main.py @@ -959,7 +959,7 @@ def run_analysis(): func(*args, **kwargs) timestamp, tool_name, args = obj.tool_calls[-1] args_str = ", ".join(f"{k}={v}" for k, v in args.items()) - with open(log_file, "a") as f: + with open(log_file, "a", encoding="utf-8") as f: f.write(f"{timestamp} [Tool Call] {tool_name}({args_str})\n") return wrapper @@ -972,7 +972,7 @@ def run_analysis(): content = obj.report_sections[section_name] if content: file_name = f"{section_name}.md" - with open(report_dir / file_name, "w") as f: + with open(report_dir / file_name, "w", encoding="utf-8") as f: f.write(content) return wrapper