Skip to content

Fix UnicodeDecodeError in test_the_javascript_side_agrees under non-UTF-8 locale - #638

Merged
lywinged merged 1 commit into
agentrust-io:mainfrom
rajnisht7:fix-test-js-side
Oct 27, 2026
Merged

lywinged merged 1 commit into
agentrust-io:mainfrom
rajnisht7:fix-test-js-side

Conversation

@rajnisht7

Copy link
Copy Markdown
Member

What this changes

test_the_javascript_side_agrees (tests/test_integer_by_value.py) ran node --version and node --test via subprocess.run(..., text=True) with no encoding= set. Without it, Python decodes the child's stdout/stderr using the ambient locale's preferred encoding. The CI "Portability" job runs the suite under LC_ALL=C PYTHONUTF8=0, which resolves that to plain ASCII, so any non-ASCII byte in Node's output (UTF-8) crashes the decode instead of letting the test assert pass/fail normally.

Type of change

  • Editorial (typo, link fix, clarification: no normative effect)
  • Non-breaking spec change (new optional field, new platform profile, informative addition)
  • Breaking spec change (requires 14-day comment period and Project Lead sign-off)
  • Schema change
  • Example addition

Spec section

None

Tests for a fix

Checklist

  • DCO sign-off on all commits (git commit -s)
  • CHANGELOG.md updated (for any normative change)
  • Breaking changes marked with <!-- CHANGED: #NNN: description --> in spec text
  • Backward compatibility statement included (for breaking changes)

Signed-off-by: rajnisht7 <rajnishtiwari9787@gmail.com>
@rajnisht7
rajnisht7 requested review from a team and lywinged as code owners October 27, 2026 04:20

@lywinged lywinged left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved. Reviewed at 2dfb0fe on da69b31. The diagnosis is right: node --test defaults to the spec reporter from Node 23, ubuntu-latest is moving to the Ubuntu 26.04 image, which carries Node 24, and the spec reporter's ✔ and ℹ are what the ASCII codec of LC_ALL=C PYTHONUTF8=0 refuses. With Node 22 given --test-reporter=spec through NODE_OPTIONS here, this test is the one failure in the root suite on main, and it passes on this head, on 3.11 and on 3.12. The measurements are on #624.

#624, which dinakarjs opened first for the same failure, made the same change to the node --test call and is merged now. This PR merges cleanly on top, and what it adds is the node --version call, which prints an ASCII version string such as v24.21.0: with that encoding removed and the other kept, the test passes under the same conditions, so it changes no outcome, and it keeps the two calls alike.

@lywinged
lywinged merged commit 42e7210 into agentrust-io:main Oct 27, 2026
12 checks passed
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