mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-04-25 00:51:20 +00:00
fix: make _is_write_denied robust to Path objects (#1678)
Cast path to str() before os.path.expanduser() to handle pathlib.Path inputs safely. Based on PR #1051 by JackTheGit. Co-authored-by: JackTheGit <JackTheGit@users.noreply.github.com>
This commit is contained in:
parent
1d5a39e002
commit
d9a7b83ae3
1 changed files with 1 additions and 1 deletions
|
|
@ -94,7 +94,7 @@ def _get_safe_write_root() -> Optional[str]:
|
|||
|
||||
def _is_write_denied(path: str) -> bool:
|
||||
"""Return True if path is on the write deny list."""
|
||||
resolved = os.path.realpath(os.path.expanduser(path))
|
||||
resolved = os.path.realpath(os.path.expanduser(str(path)))
|
||||
|
||||
# 1) Static deny list
|
||||
if resolved in WRITE_DENIED_PATHS:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue