Skip to content

fix: add encoding="utf-8" to open() calls in agbench and magentic-one-cli#7697

Open
EvanYao826 wants to merge 3 commits into
microsoft:mainfrom
EvanYao826:fix/encoding-utf8
Open

fix: add encoding="utf-8" to open() calls in agbench and magentic-one-cli#7697
EvanYao826 wants to merge 3 commits into
microsoft:mainfrom
EvanYao826:fix/encoding-utf8

Conversation

@EvanYao826
Copy link
Copy Markdown

Summary

Fixes #5566

Add explicit UTF-8 encoding to text file operations to prevent UnicodeDecodeError on Windows with non-English locales (e.g., cp950 for Traditional Chinese).

Changes

Files fixed:

  • agbench/benchmarks/HumanEval/Templates/AgentChat/scenario.py
  • agbench/benchmarks/HumanEval/Templates/AgentChat/custom_code_executor.py
  • agbench/benchmarks/GAIA/Templates/MagenticOne/scenario.py
  • agbench/benchmarks/GAIA/Templates/ParallelAgents/scenario.py
  • agbench/benchmarks/GAIA/Templates/SelectorGroupChat/scenario.py
  • autogen-ext/examples/mcp_session_host_example.py
  • autogen-ext/src/autogen_ext/code_executors/docker_jupyter/_docker_jupyter.py
  • magentic-one-cli/src/magentic_one_cli/_m1.py

All open() calls for text files now include encoding="utf-8" explicitly.

Add a public method to retrieve the current message thread from a
group chat team after or during a run.

- Add  and  event types
  in  for the RPC protocol.
- Add  RPC handler in  that
  returns a shallow copy of the internal message thread.
- Add  public method on  that returns
  a snapshot of the message thread accumulated during runs.
- Track messages in  on BaseGroupChat during run_stream,
  clear on reset.
- Add 4 pytest-asyncio tests covering: after-run retrieval, not-
  initialized error, snapshot isolation, and no-task continuation.

Closes microsoft#6085

Signed-off-by: EvanYao826 <2869018789@qq.com>
…-cli

Add explicit UTF-8 encoding to text file operations to prevent
UnicodeDecodeError on Windows with non-English locales (e.g., cp950
for Traditional Chinese).

Files fixed:
- agbench/benchmarks/HumanEval/Templates/AgentChat/scenario.py
- agbench/benchmarks/HumanEval/Templates/AgentChat/custom_code_executor.py
- agbench/benchmarks/GAIA/Templates/MagenticOne/scenario.py
- agbench/benchmarks/GAIA/Templates/ParallelAgents/scenario.py
- agbench/benchmarks/GAIA/Templates/SelectorGroupChat/scenario.py
- autogen-ext/examples/mcp_session_host_example.py
- autogen-ext/src/autogen_ext/code_executors/docker_jupyter/_docker_jupyter.py
- magentic-one-cli/src/magentic_one_cli/_m1.py

Fixes microsoft#5566
Add explicit UTF-8 encoding to text file operations to prevent
UnicodeDecodeError on Windows with non-English locales (e.g., cp950
for Traditional Chinese).

Files fixed:
- task_centric_memory/utils/chat_completion_client_recorder.py (2 calls)
- task_centric_memory/utils/page_logger.py (3 calls)
- magentic-one-cli/_m1.py (1 call missed in prior commit)
- agbench/src/agbench/linter/cli.py (1 call)
- agbench/src/agbench/linter/coders/oai_coder.py (2 calls)
- agbench/src/agbench/remove_missing_cmd.py (1 call)
- agbench/src/agbench/run_cmd.py (9 calls)
- agbench/src/agbench/tabulate_cmd.py (2 calls)

Fixes microsoft#5566
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

open needs encoding='utf-8' for non-english environment, error in playwright_controller.py

1 participant