ExecContext: Map ENOTDIR to FileNotFoundError
All checks were successful
CI / Packaging - Kali Linux (pull_request) Successful in 5m15s
CI / Packaging - OpenSUSE Tumbleweed (pull_request) Successful in 4m53s
CI / Packaging test (pull_request) Successful in 0s
CI / Packaging - Kali Linux (push) Successful in 5m23s
CI / Packaging - OpenSUSE Tumbleweed (push) Successful in 4m40s
CI / Packaging test (push) Successful in 0s
All checks were successful
CI / Packaging - Kali Linux (pull_request) Successful in 5m15s
CI / Packaging - OpenSUSE Tumbleweed (pull_request) Successful in 4m53s
CI / Packaging test (pull_request) Successful in 0s
CI / Packaging - Kali Linux (push) Successful in 5m23s
CI / Packaging - OpenSUSE Tumbleweed (push) Successful in 4m40s
CI / Packaging test (push) Successful in 0s
_raise_stat_error() maps the message of a failed remote stat to an exception. A stat below a file answers "not a directory", which falls through to the generic EIO: the path is simply absent, and callers see a re-raised error instead of the FileNotFoundError the "no such file" branch already gives. Map it to FileNotFoundError, so existence checks see absence. Assisted-by: unsloth/Qwen3.8-27B-GGUF:Q4_K_M with pi.dev v0.99.2 Signed-off-by: Jan Lindemann <jan@janware.com>
This commit is contained in:
parent
55db326898
commit
ec89205cbb
1 changed files with 2 additions and 0 deletions
|
|
@ -37,6 +37,8 @@ def _raise_stat_error(path: str, result: Result) -> None:
|
|||
lower = msg.lower()
|
||||
if 'no such file' in lower:
|
||||
raise FileNotFoundError(errno.ENOENT, msg, path)
|
||||
if 'not a directory' in lower:
|
||||
raise FileNotFoundError(errno.ENOTDIR, msg, path)
|
||||
if 'permission denied' in lower or 'operation not permitted' in lower:
|
||||
raise PermissionError(errno.EACCES, msg, path)
|
||||
raise OSError(errno.EIO, msg, path)
|
||||
|
|
|
|||
Loading…
Reference in a new issue