You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Should exit with non-zero code when scanning fails #1326
When bandit is unable to scan one or more files (e.g. due to Python 3.14 as in #1219 or non-UTF-8 characters as in #882) it still exits with exit code 0, which is misleading and makes it more difficult to check the result programmatically (e.g. to fail a build in CI systems).
Reproduction steps
1. Run bandit using Python 3.14 in any project.
2. Observe that the "Files skipped" section of the output lists all .py files with "(exception while scanning file)" and the exit code is 0.
Expected behavior
bandit would exit with a non-zero exit code to indicate failure. (Perhaps code 2 to distinguish internal errors from failed tests which set exit code 1?)
Activity