Skip to content

fix(test): specify encoding=utf-8 reading BaseRobot.py/pyproject.toml#548

Merged
petercorke merged 1 commit into
mainfrom
fix/windows-encoding-test-backend-capabilities
Jul 5, 2026
Merged

fix(test): specify encoding=utf-8 reading BaseRobot.py/pyproject.toml#548
petercorke merged 1 commit into
mainfrom
fix/windows-encoding-test-backend-capabilities

Conversation

@petercorke

Copy link
Copy Markdown
Owner

Summary

  • main itself is currently failing CI on every Windows job (confirmed via gh run list --branch main — latest run's conclusion is failure), which was also failing identically on every one of fix(mobile): guard VehicleDriverBase against workspace=None #541-fix(models): make KinovaGen3 load via robot_descriptions, add XACRO_ARGS support #546 since they all inherit from main.
  • Root cause: tests/test_backend_capabilities.py opens BaseRobot.py (twice) and pyproject.toml with plain open(path) — no encoding specified. Windows defaults to the locale codepage (cp1252) rather than UTF-8. BaseRobot.py's docstrings contain a stylized Unicode math italic "𝜋" (U+1D70B), which cp1252 can't decode → UnicodeDecodeError on every Windows job, every PR.
  • Fix: add encoding="utf-8" to all three open() calls. Confirmed these were the only unencoded open() calls in tests/.
  • Note: macOS jobs on some of these PRs also show failures, but that's the already-documented, unrelated test_IK_GN3 numerical flakiness (tech-debt.md) — not touched by this PR.

Test plan

  • pytest tests/test_backend_capabilities.py — 21 passed, 4 skipped
  • Full suite: 652 passed, 13 skipped, no regressions
  • Can't reproduce the Windows-specific default-codepage behavior on macOS directly, but the fix (explicit encoding="utf-8") is correct on every platform regardless — it's the only way to guarantee the file (an actual UTF-8 source file) decodes correctly no matter the OS locale.

🤖 Generated with Claude Code

….toml

Windows' open() defaults to the locale codepage (cp1252), not UTF-8.
BaseRobot.py's docstrings contain a stylized Unicode math italic pi
(U+1D70B), so every open(path) without an explicit encoding here failed
with UnicodeDecodeError on every Windows CI job -- this was breaking
main itself, not just feature branches built on top of it.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@codecov

codecov Bot commented Jul 5, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 0.00%. Comparing base (a9ed8d4) to head (6d064ed).
⚠️ Report is 42 commits behind head on main.

Additional details and impacted files
@@          Coverage Diff           @@
##            main    #548    +/-   ##
======================================
  Coverage   0.00%   0.00%            
======================================
  Files        137     137            
  Lines      13690   13434   -256     
======================================
+ Misses     13690   13434   -256     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@petercorke petercorke merged commit ea4acff into main Jul 5, 2026
18 checks passed
@petercorke petercorke deleted the fix/windows-encoding-test-backend-capabilities branch July 5, 2026 08:00
@github-actions github-actions Bot mentioned this pull request Jul 5, 2026
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.

1 participant