Describe the bug
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?)
Bandit version
1.8.3 (Default)
Python version
3.13 (Default)
Additional context
No response
Describe the bug
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
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?)
Bandit version
1.8.3 (Default)
Python version
3.13 (Default)
Additional context
No response