fix: add explicit UTF-8 encoding to all file open() calls

Prevents UnicodeEncodeError on Windows where the default encoding
(cp1252/gbk) cannot handle Unicode characters in LLM output.

Closes #77, closes #114, closes #126, closes #215, closes #332
This commit is contained in:
Yijia-Xiao
2026-03-15 16:43:37 +00:00
parent 907bc8022a
commit 3642f5917c
2 changed files with 5 additions and 4 deletions
+1
View File
@@ -260,6 +260,7 @@ class TradingAgentsGraph:
with open(
f"eval_results/{self.ticker}/TradingAgentsStrategy_logs/full_states_log_{trade_date}.json",
"w",
encoding="utf-8",
) as f:
json.dump(self.log_states_dict, f, indent=4)