Skip to content

fix(dashboard-api): handle permission errors during file existence check in gguf_inspector.py - #2514

Open
vaibhavsrv wants to merge 1 commit into
Osmantic:mainfrom
vaibhavsrv:fix/dashboard-api-gguf-inspector-stat-permission
Open

fix(dashboard-api): handle permission errors during file existence check in gguf_inspector.py#2514
vaibhavsrv wants to merge 1 commit into
Osmantic:mainfrom
vaibhavsrv:fix/dashboard-api-gguf-inspector-stat-permission

Conversation

@vaibhavsrv

Copy link
Copy Markdown
Contributor

Problem

In ods/extensions/services/dashboard-api/gguf_inspector.py, inspect_gguf() evaluated p.exists() directly in dictionary initialization. If the target path points to a broken symlink or restricted path, p.exists() can raise OSError or PermissionError outside the parser's error handler block.

Fix

Wrap p.exists() inside a try...except OSError block, assigning exists = False cleanly on access errors.

Verification

Verified syntax with python3 -m py_compile ods/extensions/services/dashboard-api/gguf_inspector.py. git diff --check passed cleanly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant