Skip to content

A programming framework for agentic AI

fix: [autogenbench] writing to stdout encoding error in win-os (#2002)

Eduardo Salinas6dbae0a88b1a
diff --git a/samples/tools/autogenbench/autogenbench/run_cmd.py b/samples/tools/autogenbench/autogenbench/run_cmd.py
index e548a16b8..a8674ea71 100644
--- a/samples/tools/autogenbench/autogenbench/run_cmd.py
+++ b/samples/tools/autogenbench/autogenbench/run_cmd.py
@@ -500,6 +500,7 @@ echo RUN.SH COMPLETE !#!#
chunk = chunk.decode("utf-8")
log_file.write(chunk)
log_file.flush()
+ sys.stdout.reconfigure(encoding="utf-8")
sys.stdout.write(chunk)
sys.stdout.flush()