bandit fails to run with medium severity under python 3.4

Bug #1479996 reported by Austin English
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Bandit
Invalid
Undecided
Unassigned

Bug Description

austin@aw25 ~/src $ bandit -r my_python_project/ -ll -n3
[bandit] INFO using config: /usr/lib64/python3.4/site-packages/bandit/config/bandit.yaml
[bandit] INFO running on Python 3.4.3
104 [0.. 50.. 100.. ]
Traceback (most recent call last):
  File "/usr/lib/python-exec/python3.4/bandit", line 10, in <module>
    sys.exit(main())
  File "/usr/lib64/python3.4/site-packages/bandit/bandit.py", line 155, in main
    args.output_format)
  File "/usr/lib64/python3.4/site-packages/bandit/core/manager.py", line 114, in output_results
    output_format=output_format
  File "/usr/lib64/python3.4/site-packages/bandit/core/result_store.py", line 123, in report
    self._write_report(files_list, scores, excluded_files)
  File "/usr/lib64/python3.4/site-packages/bandit/core/result_store.py", line 96, in _write_report
    report_func(self, files_list, scores, excluded_files=excluded_files)
  File "/usr/lib64/python3.4/site-packages/bandit/core/formatters.py", line 202, in report_text
    result_store._get_code(issue, True))
  File "/usr/lib64/python3.4/site-packages/bandit/core/result_store.py", line 164, in _get_code
    file_len)
  File "/usr/lib64/python3.4/site-packages/bandit/core/utils.py", line 175, in lines_with_context
    l_range = l_range[start:end + 1]
TypeError: slice indices must be integers or None or have an __index__ method

either going to -lll (high) and/or removing -n3 seems to avoid the problem.

Revision history for this message
Austin English (austinenglish) wrote :

Mismatched python versions, closing invalid.

Changed in bandit:
status: New → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.