Open eugene-davis opened 5 years ago
This is an interesting issue you've uncovered. It is almost certainly because we override sys.stdout in order to get proper bandit output on the terminal.
But from a cursory Google search, this error would only happen if some other code has detached sys.stdout, which we don't do. So without a little context from the program you're testing, I'm not sure we can get to the bottom of this.
I can provide the extra context for sure. First off, here's the PR where I tried to enable it on a particular project: https://github.com/tomtom-international/ebr-board/pull/9
This executes on Azure DevOps pipelines in the vs2017-win2016 image (defined here: https://github.com/tomtom-international/azure-pipeline-templates/blob/master/jobs/python.setup.py.yml#L31)
The actual PyTest command is executed here: https://github.com/tomtom-international/azure-pipeline-templates/blob/master/steps/python/python.build.yml#L29
Let me know how I can help.
Hm, interesting, it's definitely specific to Windows. I'll try to get a development environment set up so I can debug a bit further. Thanks for the links, I should be able to use that Docker container.
When running pytest-bandit on Windows (Python 3.5, 3.6, 3.7) I get the following message.