mirror of
https://github.com/farcasclaudiu/TradingAgents.git
synced 2026-06-22 07:01:21 +03:00
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:
@@ -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)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user