Skip to content
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

hardcoded_password_default fails on python2 comparing with ast.arg #428

Closed
ehooo opened this issue Nov 16, 2018 · 2 comments
Closed

hardcoded_password_default fails on python2 comparing with ast.arg #428

ehooo opened this issue Nov 16, 2018 · 2 comments
Labels
bug Something isn't working

Comments

@ehooo
Copy link
Contributor

ehooo commented Nov 16, 2018

Describe the bug
hardcoded_password_default check with ast.arg on python2

To Reproduce
Steps to reproduce the behaviour:

  1. Run bandit with python2
  2. Create a file with:
def my_funct((a, b)):
    pass

Expected behaviour
Check the python version before check with ast.arg

Bandit version

bandit 1.5.1
  python version = 2.7.12 (default, Dec  4 2017, 14:50:18) [GCC 5.4.0 20160609]

Traceback

[tester]        ERROR   Bandit internal error running: hardcoded_password_default on file test.py at line 1: 'module' object has no attribute 'arg'Traceback (most recent call last):
  File "/home/vtorre/.virtualenvs/bandit/local/lib/python2.7/site-packages/bandit/core/tester.py", line 64, in run_tests
    result = test(context)
  File "/home/vtorre/.virtualenvs/bandit/local/lib/python2.7/site-packages/bandit/plugins/general_hardcoded_password.py", line 212, in hardcoded_password_default
    if isinstance(key, ast.Name) or isinstance(key, ast.arg):
AttributeError: 'module' object has no attribute 'arg'
@ehooo
Copy link
Contributor Author

ehooo commented Nov 16, 2018

I also fix on #387
@sigmavirus24 @ericwb @lukehinds could you take a look?
Thanks in advance.

@ericwb ericwb added the bug Something isn't working label Nov 19, 2018
@lukehinds
Copy link
Member

@ehooo I think we can close this now? (fixed in #387)?

@ehooo ehooo closed this as completed Jan 25, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants