Skip to content

fix(mcp-builder): specify utf-8 encoding in evaluation.py file writes (#1669) - #1683

Open
LuckTerence wants to merge 1 commit into
anthropics:mainfrom
LuckTerence:fix/eval-windows-utf8-encoding
Open

fix(mcp-builder): specify utf-8 encoding in evaluation.py file writes (#1669)#1683
LuckTerence wants to merge 1 commit into
anthropics:mainfrom
LuckTerence:fix/eval-windows-utf8-encoding

Conversation

@LuckTerence

Copy link
Copy Markdown

Closes #1669

Problem

In skills/mcp-builder/scripts/evaluation.py, the evaluation report is written using args.output.write_text(report) without specifying an encoding. On Windows systems where the default locale encoding is cp1252, attempting to write reports containing emoji markers (, ) or non-ASCII characters results in a UnicodeEncodeError. Because this occurs on the final write step after all evaluation tasks have finished, the entire run's output is lost.

Fix

Added explicit encoding="utf-8" to args.output.write_text(report, encoding="utf-8") in skills/mcp-builder/scripts/evaluation.py.

Testing

  • Verified Python syntax compilation using py_compile.
  • Tested encoding behavior with emoji report output.

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.

mcp-builder: evaluation.py discards a completed run on Windows — write_text() without encoding hits cp1252 on the report's emoji

1 participant