From 8d0aba12a393d274d70ec9fb44ce0399bde244a8 Mon Sep 17 00:00:00 2001 From: BranJ2106 Date: Sun, 22 Mar 2026 22:27:57 -0600 Subject: [PATCH] CLI change to read correctly all files MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Ahora los logs y reportes se escriben con encoding="utf-8" en las tres aperturas de archivo que estaban usando la codificación por defecto de Windows. --- cli/main.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/cli/main.py b/cli/main.py index 53837db2..f6d8ffd6 100644 --- a/cli/main.py +++ b/cli/main.py @@ -968,7 +968,7 @@ def run_analysis(): func(*args, **kwargs) timestamp, message_type, content = obj.messages[-1] content = content.replace("\n", " ") # Replace newlines with spaces - with open(log_file, "a") as f: + with open(log_file, "a", encoding="utf-8") as f: f.write(f"{timestamp} [{message_type}] {content}\n") return wrapper @@ -979,7 +979,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 @@ -993,7 +993,7 @@ def run_analysis(): if content: file_name = f"{section_name}.md" text = "\n".join(str(item) for item in content) if isinstance(content, list) else content - with open(report_dir / file_name, "w") as f: + with open(report_dir / file_name, "w", encoding="utf-8") as f: f.write(text) return wrapper