Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions hermes_cli/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -470,7 +470,7 @@ def _resolve_sudo_user_profile_env(name: str) -> str | None:

active_path = get_default_hermes_root() / "active_profile"
if active_path.exists():
name = active_path.read_text().strip()
name = active_path.read_text(encoding="utf-8").strip()
if name and name != "default":
profile_name = name
consume = 0 # don't strip anything from argv
Expand Down Expand Up @@ -846,7 +846,7 @@ def _has_any_provider_configured() -> bool:
try:
import json

auth = json.loads(auth_file.read_text())
auth = json.loads(auth_file.read_text(encoding="utf-8"))
active = auth.get("active_provider")
if active:
status = get_auth_status(active)
Expand Down Expand Up @@ -4522,15 +4522,15 @@ def _gateway_prompt(prompt_text: str, default: str = "", timeout: float = 300.0)
"id": str(_uuid.uuid4()),
}
tmp = prompt_path.with_suffix(".tmp")
tmp.write_text(_json.dumps(payload))
tmp.write_text(_json.dumps(payload), encoding="utf-8")
tmp.replace(prompt_path)

# Poll for response
deadline = _time.monotonic() + timeout
while _time.monotonic() < deadline:
if response_path.exists():
try:
answer = response_path.read_text().strip()
answer = response_path.read_text(encoding="utf-8").strip()
response_path.unlink(missing_ok=True)
prompt_path.unlink(missing_ok=True)
return answer if answer else default
Expand Down Expand Up @@ -9631,7 +9631,7 @@ def _print_items(items, label, key, fallback_key=None):
if gateway_mode:
_exit_code_path = get_hermes_home() / ".update_exit_code"
try:
_exit_code_path.write_text("0")
_exit_code_path.write_text("0", encoding="utf-8")
except OSError:
pass

Expand Down Expand Up @@ -11016,7 +11016,7 @@ def _render_distribution_plan(plan) -> None:
env_path = plan.target_dir / ".env"
if env_path.is_file():
try:
for raw in env_path.read_text().splitlines():
for raw in env_path.read_text(encoding="utf-8").splitlines():
line = raw.strip()
if not line or line.startswith("#"):
continue
Expand Down