mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-07-25 17:18:11 +00:00
test(install): add UTF-8 regression guard for skills_sync child path
Addresses hermes-sweeper review on PR #54866: the installer runs tools/skills_sync.py as a child python.exe whose PYTHONIOENCODING / PYTHONUTF8 the scoped install.ps1 block sets, but there was no regression test for this child-Python UTF-8 path. The existing test_child_process_inherits_utf8_mode covers a different (bootstrap entry-point) flow. Add TestSkillsSyncUtf8Guard: three subprocess tests that import skills_sync (triggering its import-time stdout/stderr reconfigure) and assert the checkmark/up-arrow glyphs the script prints at tools/skills_sync.py:596,675 emit valid UTF-8 and exit 0 even when the child env is left unset or explicitly hostile (gbk). A third test proves the guard is load-bearing by reproducing the crash without it. Also keep the new install.ps1 comment ASCII-only (the checkmark spelled out as U+2713) per the file's PS 5.1 parser-compatibility contract at scripts/install.ps1:79-80; the literal glyph in the comment violated that contract.
This commit is contained in:
parent
3f1de1fc4a
commit
44649e69f4
2 changed files with 5 additions and 3 deletions
|
|
@ -2438,9 +2438,10 @@ You are Hermes Agent, an intelligent AI assistant created by Nous Research. You
|
|||
# Force the child python.exe to emit UTF-8 on its stdout/stderr.
|
||||
# On non-UTF-8 Windows locales (CP936/GBK zh-CN) Python defaults
|
||||
# its stream encoding to the active codepage and crashes on glyphs
|
||||
# like ✓ (U+2713) that the codepage can't encode; the resulting
|
||||
# non-UTF-8 bytes break this script's JSON result frame on stdout
|
||||
# and abort the config-templates stage. Scope to this call only.
|
||||
# like the checkmark (U+2713) that the codepage can't encode; the
|
||||
# resulting non-UTF-8 bytes break this script's JSON result frame on
|
||||
# stdout and abort the config-templates stage. Scope to this call
|
||||
# only. (Comment kept ASCII per this file's PS 5.1 contract above.)
|
||||
$prevPythonioencoding = $env:PYTHONIOENCODING
|
||||
$prevPythonutf8 = $env:PYTHONUTF8
|
||||
$env:PYTHONIOENCODING = "utf-8"
|
||||
|
|
|
|||
|
|
@ -24,6 +24,7 @@ import os
|
|||
import subprocess
|
||||
import sys
|
||||
import textwrap
|
||||
from pathlib import Path
|
||||
|
||||
import pytest
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue