Skip to content

Commit e49845b

Browse files
committed
fix(powershell,tests): enforce UTF-8 in common.ps1 and isolate integration env vars in tests
- scripts/powershell/common.ps1: Enforce [Console]::OutputEncoding and $OutputEncoding as UTF-8. On Windows hosts with non-UTF-8/OEM code pages (such as CP950/Big5), PowerShell stdout would otherwise output non-ASCII characters (e.g. arrows in templates) using the system code page, causing UnicodeDecodeError when captured by external runners. - tests/conftest.py: Drop ambient SPECKIT_INTEGRATION_*_EXTRA_ARGS and SPECKIT_INTEGRATION_*_EXECUTABLE environment variables in the autouse _strip_specify_env fixture to prevent host configuration leakage into integration argument-building tests. Assisted-by: Antigravity (model: Gemini 3.8 Flash, supervised)
1 parent 0a10d66 commit e49845b

2 files changed

Lines changed: 8 additions & 0 deletions

File tree

scripts/powershell/common.ps1

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
#!/usr/bin/env pwsh
22
# Common PowerShell functions analogous to common.sh
33

4+
[Console]::OutputEncoding = [System.Text.Encoding]::UTF8
5+
$OutputEncoding = [System.Text.Encoding]::UTF8
6+
47
# Find repository root by searching upward for .specify directory
58
# This is the primary marker for spec-kit projects
69
function Find-SpecifyRoot {

tests/conftest.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,11 @@ def _strip_specify_env(monkeypatch):
9595
that wants an override sets it explicitly via monkeypatch afterwards."""
9696
for key in [k for k in os.environ if k.startswith("SPECIFY_")]:
9797
monkeypatch.delenv(key, raising=False)
98+
for key in list(os.environ):
99+
if key.startswith("SPECKIT_INTEGRATION_") and (
100+
key.endswith("_EXTRA_ARGS") or key.endswith("_EXECUTABLE")
101+
):
102+
monkeypatch.delenv(key, raising=False)
98103

99104

100105
@pytest.fixture

0 commit comments

Comments
 (0)