-
-
Notifications
You must be signed in to change notification settings - Fork 606
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 to crash #362
Comments
I visited this repository to report the same issue, can back up the original finding. |
Wonder if it is bandit 1.4.0, I tried this and don't seem to see the issue. http://paste.openstack.org/show/727859/ |
I wasn't able to recreate it either. But I haven't tried the combo of Python 3.6 with Bandit 1.4.0 yet. At the very least, even if fixed in master, we could add a new unit test for this. |
I grabbed my MacBook and tried it on there and I got the same result as @stannum-l. I think it's a Windows issue. |
Ah, that makes sense. Don't think windows console support unicode; perhaps that's why there is an error. |
Ok so I whipped out the debugger and found out that for some reason, on Windows, the file opened by Opened a PR at #364 |
Have you tried setting the encoding in the Python file? Python will default to ASCII as standard encoding if no other encoding hints are given. If using Unicode characters, according to PEP 263 you should declare the encoding within your Python file. https://www.python.org/dev/peps/pep-0263/
|
Issue is still present for the pre-commit hook at version 1.7.5 |
Describe the bug
If bandit output contains unicode characters, and the user attempts to create a report file, then Bandit will crash.
To Reproduce
Steps to reproduce the behavior:
test.py
:Expected behavior
I expect Bandit to successfully create the report, either by handing unicode encodings, or by removing the problematic unicode characters.
Bandit version
The text was updated successfully, but these errors were encountered: