Skip to content

Fix Windows benchmark failure: add UTF-8 encoding to all file I/O#128

Merged
brunoborges merged 2 commits intomainfrom
copilot/fix-github-actions-workflow-yet-again
Mar 2, 2026
Merged

Fix Windows benchmark failure: add UTF-8 encoding to all file I/O#128
brunoborges merged 2 commits intomainfrom
copilot/fix-github-actions-workflow-yet-again

Conversation

Copy link
Contributor

Copilot AI commented Mar 2, 2026

The benchmark (windows-latest) job was failing immediately after startup because generate.py and generateog.py called open() without encoding='utf-8'. On Windows, the default encoding is cp1252, which chokes on the UTF-8 content present throughout the repo.

The crash happened at module load time: _load_properties(LOCALES_FILE) is called at the top level of generate.py, and locales.properties contains flag emojis and non-ASCII locale names (🇬🇧, 中文, العربية, etc.) that cp1252 cannot decode. Content YAML files compound this with emoji in whyModernWins icons (📏, 🔒, etc.).

Changes

  • generate.py — add encoding="utf-8" to all 6 open() calls (properties, YAML/JSON reads, HTML/JSON/index writes)
  • generateog.py — same fix for all 3 open() calls (properties, YAML/JSON reads, SVG writes)
  • benchmark.yml — fix both snippet_count calculations to match .yaml/.yml/.json files; the old -name '*.json' filter found only content/template.json, reporting "1 snippets" instead of ~112
# Before — crashes on Windows when reading locales.properties
with open(path) as f: ...

# After
with open(path, encoding="utf-8") as f: ...
Original prompt

Fix the failing GitHub Actions workflow benchmark (windows-latest)
Analyze the workflow logs, identify the root cause of the failure, and implement a fix.
Job ID: 65349663712
Job URL: https://github.com/javaevolved/javaevolved.github.io/actions/runs/22561737825/job/65349663712


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

…nerators

Co-authored-by: brunoborges <129743+brunoborges@users.noreply.github.com>
@brunoborges brunoborges marked this pull request as ready for review March 2, 2026 05:00
@brunoborges brunoborges merged commit 9795287 into main Mar 2, 2026
Copilot AI changed the title [WIP] Fix failing GitHub Actions workflow benchmark Fix Windows benchmark failure: add UTF-8 encoding to all file I/O Mar 2, 2026
Copilot stopped work on behalf of brunoborges due to an error March 2, 2026 05:01
@brunoborges brunoborges deleted the copilot/fix-github-actions-workflow-yet-again branch March 2, 2026 23:33
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.

2 participants