New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Reports that contain Unicode will cause Bandit pre-commit hook to crash #1040
Labels
bug
Something isn't working
Comments
Just had the same issue. |
I'm not able to reproduce on macOS. What operating system are you using? What is the value of your TERM environment variable?
|
Hi, I am using Windows. I am able to reproduce the issue on Powershell 7 (7.4.1), Command Prompt and Git Bash (TERM = xterm-256color). |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Describe the bug
When using the pre-commit hook on a file with unicode characters in it, Bandit will crash.
The bug was fixed for CLI in #362 but the issue is still present when using the pre-commit hook.
Reproduction steps
test.py
:.pre-commit-config.yaml
:Install the
pre-commit
Python package (e.g., withpipx
)Install the pre-commit hooks:
git add .
Expected behavior
I expect Bandit to successfully create the report, either by handing unicode encodings, or by removing the problematic unicode characters.
Bandit version
1.7.5 (Default)
Python version
3.11 (Default)
The text was updated successfully, but these errors were encountered: