bandit icon indicating copy to clipboard operation
bandit copied to clipboard

Runtime error with screen/text formating

Open MVrachev opened this issue 6 years ago • 5 comments

Describe the bug I am scanning many repositories with a single command

bandit -v -ii -lll -r ./

and I get this result: image

Same happens with this command:

bandit -f txt-v -ii -lll -r ./

image

To Reproduce Steps to reproduce the behavior: Not sure how to reproduce to be honest. :D Maybe just do as I did scan a lot of repositories using the default output.

Expected behavior Normally I would expect a normal issue report.

Bandit version

1.5.1

Additional context macOs Mojave version 10.14.3

MVrachev avatar Apr 10 '19 05:04 MVrachev

I installed Bandit for python3 and again I get this:

image

with this command:

bandit -v -ii -lll -r ./

MVrachev avatar Apr 10 '19 07:04 MVrachev

Is this within a screen session? It seems to be some issues with unicode rendering.

lukehinds avatar Apr 10 '19 12:04 lukehinds

I'm getting a similar issue using Git Bash on Windows 10. With Python 3.7.3 and Release 1.6.2 of bandit.

File "<me>\AppData\Roaming\Python\Python37\site-packages\bandit\core\manager.py", line 173, in output_results "%s" % (output_format, str(e)))
RuntimeError: Unable to output report using 'txt' formatter: 'charmap' codec can't encode character '\u0130' in position 155969: character maps to <undefined>

I also ran this on Ubuntu 18.04LTS (WSL) with Python 3.7.5 and it seemed to work fine.

pandorazboxx avatar Oct 19 '20 20:10 pandorazboxx

Interestingly.... this works just fine in powershell. So, there's a workaround for anyone on Windows running into the same problem.

pandorazboxx avatar Oct 19 '20 20:10 pandorazboxx

We will need the python code Bandit was run against in order to duplicate and resolve. At this point, I can't reproduce.

ericwb avatar Mar 27 '22 02:03 ericwb