Skip to content

The agent that grows with you

test(gateway): canonical routes fixture writes/reads text as UTF-8

Tekniumc75d26ae892c
diff --git a/tests/gateway/fixtures/tui_desktop_routes_peer.py b/tests/gateway/fixtures/tui_desktop_routes_peer.py
index e81ecca0cea..3b712b1fff2 100644
--- a/tests/gateway/fixtures/tui_desktop_routes_peer.py
+++ b/tests/gateway/fixtures/tui_desktop_routes_peer.py
@@ -34,7 +34,7 @@ async def probe(mode):
home = Path(os.environ['HERMES_HOME'])
marker = home / 'quick-exec-ran'
- (home / 'config.yaml').write_text(_CONFIG.format(marker=marker))
+ (home / 'config.yaml').write_text(_CONFIG.format(marker=marker), encoding='utf-8')
runner = GatewayRunner()
authority = await initialize_session_authority(runner, profile_id=str(home), instance_id='routes')
api = await start_gateway_api(runner)
@@ -55,7 +55,7 @@ async def probe(mode):
sid = created['result']['session_id']
receipt = {'mode': mode, 'authenticated_ws': True}
await MODES[mode](authority, ws, reader, sid, marker, receipt)
- (home / 'receipt.json').write_text(json.dumps(receipt))
+ (home / 'receipt.json').write_text(json.dumps(receipt), encoding='utf-8')
finally:
await reader.close()
await stop_gateway_api(api)
diff --git a/tests/gateway/test_canonical_tui_desktop_routes.py b/tests/gateway/test_canonical_tui_desktop_routes.py
index 583e179c6bc..092a4d2d28e 100644
--- a/tests/gateway/test_canonical_tui_desktop_routes.py
+++ b/tests/gateway/test_canonical_tui_desktop_routes.py
@@ -20,7 +20,7 @@ def probe(tmp_path, mode):
result = subprocess.run([sys.executable, str(root / 'tests/gateway/fixtures/tui_desktop_routes_peer.py'), mode],
cwd=root, env=env, capture_output=True, text=True, timeout=120, check=False)
assert result.returncode == 0, result.stdout + result.stderr
- receipt = json.loads((home / 'receipt.json').read_text())
+ receipt = json.loads((home / 'receipt.json').read_text(encoding='utf-8'))
assert receipt['mode'] == mode and receipt['authenticated_ws']
return receipt