Bandit fails when using importlib with named arguments

Bug #1916628 reported by Marcin Kielar
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Bandit
New
Undecided
Unassigned

Bug Description

This code:
```
importlib.import(name='some_name')
```

causes Bandit to fail like this:
```
75 [0.. [tester] ERROR Bandit internal error running: blacklist on file [MASKED]/extension_loader.py at line 52: list index out of rangeTraceback (most recent call last):
  File "[MASKED]/venv/lib64/python3.8/site-packages/bandit/core/tester.py", line 52, in run_tests
    result = test(context, test._config)
  File "[MASKED]/venv/lib64/python3.8/site-packages/bandit/core/blacklisting.py", line 50, in blacklist
    name = context.call_args[0]
IndexError: list index out of range
```

This works okay:
```
importlib.import('some_name')
```

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.