mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-04-25 00:51:20 +00:00
fix: use utf-8 encoding when reading .env file in load_env()
On Windows, Path.open() defaults to the system ANSI code page (cp1252). If the .env file contains UTF-8 characters, decoding fails with 'gbk codec can't decode byte 0x94'. Specify encoding='utf-8' explicitly to ensure consistent behavior across platforms.
This commit is contained in:
parent
6ad2fab8cf
commit
fa2dbd1bb5
1 changed files with 1 additions and 1 deletions
|
|
@ -111,7 +111,7 @@ def load_env() -> Dict[str, str]:
|
||||||
if not env_path.exists():
|
if not env_path.exists():
|
||||||
return env_vars
|
return env_vars
|
||||||
|
|
||||||
with env_path.open() as f:
|
with env_path.open(encoding="utf-8") as f:
|
||||||
for line in f:
|
for line in f:
|
||||||
line = line.strip()
|
line = line.strip()
|
||||||
if line and not line.startswith("#") and "=" in line:
|
if line and not line.startswith("#") and "=" in line:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue