fix(cli): ensure project .env is sanitized before loading

This commit is contained in:
hharry11 2026-04-22 10:10:46 +03:00 committed by Teknium
parent cf55c738e7
commit 83cb9a03ee
2 changed files with 21 additions and 0 deletions

View file

@ -160,6 +160,8 @@ def load_hermes_dotenv(
# Fix corrupted .env files before python-dotenv parses them (#8908).
if user_env.exists():
_sanitize_env_file_if_needed(user_env)
if project_env_path and project_env_path.exists():
_sanitize_env_file_if_needed(project_env_path)
if user_env.exists():
_load_dotenv_with_fallback(user_env, override=True)