Skip to content

fix: narrow exception in script permission check from Exception to OSError/PermissionError - #3916

Open
Quratulain-bilal wants to merge 1 commit into
github:mainfrom
Quratulain-bilal:fix/script-chmod-narrow-exception
Open

fix: narrow exception in script permission check from Exception to OSError/PermissionError#3916
Quratulain-bilal wants to merge 1 commit into
github:mainfrom
Quratulain-bilal:fix/script-chmod-narrow-exception

Conversation

@Quratulain-bilal

Copy link
Copy Markdown
Contributor

Problem

Bare except Exception silently swallows all errors during script permission checks.

Fix

Narrow to (OSError, PermissionError) which are the realistic failure modes for file open/read operations.

Testing

  • Verified scripts with shebang get executable permissions
  • Verified scripts without shebang are skipped

…Error/PermissionError

Bare 'except Exception' silently swallows all errors. Narrow to
(OSError, PermissionError) which are the realistic failure modes
for file open/read operations.
@Quratulain-bilal
Quratulain-bilal requested a review from mnriem as a code owner July 31, 2026 14:44
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