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

Bandit 1.7.3 addition of new positional argument fdata causes TypeError #21

Closed
RemyLau opened this issue Feb 28, 2022 · 21 comments · Fixed by #22 or #23
Closed

Bandit 1.7.3 addition of new positional argument fdata causes TypeError #21

RemyLau opened this issue Feb 28, 2022 · 21 comments · Fixed by #22 or #23

Comments

@RemyLau
Copy link

RemyLau commented Feb 28, 2022

I've been using the flake8-bandit plugin. But recently, a new positional argument fdata was recently added to the BanditNodeVisitor function in version 1.7.3, causing a TypeError as follows

multiprocessing.pool.RemoteTraceback: 
"""
Traceback (most recent call last):
  File "/mnt/home/liurenmi/software/anaconda3/envs/geneplexus/lib/python3.8/multiprocessing/pool.py", line 125, in worker
    result = (True, func(*args, **kwds))
  File "/mnt/ufs18/home-026/liurenmi/repo/GeneplexusPublic/.tox/flake8/lib/python3.8/site-packages/flake8/checker.py", line 687, in _run_checks
    return checker.run_checks()
  File "/mnt/ufs18/home-026/liurenmi/repo/GeneplexusPublic/.tox/flake8/lib/python3.8/site-packages/flake8/checker.py", line 597, in run_checks
    self.run_ast_checks()
  File "/mnt/ufs18/home-026/liurenmi/repo/GeneplexusPublic/.tox/flake8/lib/python3.8/site-packages/flake8/checker.py", line 500, in run_ast_checks
    for (line_number, offset, text, _) in runner:
  File "/mnt/ufs18/home-026/liurenmi/repo/GeneplexusPublic/.tox/flake8/lib/python3.8/site-packages/flake8_bandit.py", line 85, in run
    for warn in self._check_source():
  File "/mnt/ufs18/home-026/liurenmi/repo/GeneplexusPublic/.tox/flake8/lib/python3.8/site-packages/flake8_bandit.py", line 59, in _check_source
    bnv = BanditNodeVisitor(
TypeError: __init__() missing 1 required positional argument: 'metrics'
"""

Would it be possible to make a patch for this?

RemyLau added a commit to krishnanlab/PyGenePlexus that referenced this issue Feb 28, 2022
@kjbergman
Copy link

I’m also experiencing this issue

nastra added a commit to nastra/flake8-bandit that referenced this issue Feb 28, 2022
Fixes tylerwince#21

flake8-bandit 1.7.3 (PyCQA/bandit#496)
introduced an `fdata` argument.
nastra added a commit to nastra/flake8-bandit that referenced this issue Feb 28, 2022
Fixes tylerwince#21

flake8-bandit 1.7.3 (PyCQA/bandit#496)
introduced an `fdata` argument and this just passes a `None` to make
things work with the latest version of bandit.
PhilippWendler added a commit to sosy-lab/benchexec that referenced this issue Feb 28, 2022
Mark90 added a commit to workfloworchestrator/orchestrator-core that referenced this issue Feb 28, 2022
Mark90 added a commit to workfloworchestrator/orchestrator-core that referenced this issue Feb 28, 2022
* bumpversion to 0.3.7

* temporarily pin bandit==1.7.2 (github.com/tylerwince/flake8-bandit/issues/21)

Co-authored-by: Mark90 <mark_moes@live.nl>
sathieu added a commit to sathieu/flake8-bandit that referenced this issue Feb 28, 2022
Fixes: tylerwince#21

flake8-bandit 1.7.3 (PyCQA/bandit#496)
introduced an `fdata` argument and this just passes a `None` to make
things work with the latest version of bandit.
RemyLau added a commit to krishnanlab/PyGenePlexus that referenced this issue Feb 28, 2022
* Refactor global variables

* Fix fstring

* Refactor _geneplexus.py

* Fix typo

* Refactor get_geneid_conversion

* Temporarily disable flake8-bandit due to tylerwince/flake8-bandit#21

* Minor edits

* Remove redundant lines

* Add upper option to get_geneid_conversion

* Clean up initial_ID_convert

* Clean up make_validation_df

* Refactor loaders

* Create a genearl _load_file method with file existence check

* Merge loader into util, create pickle loaders

* Type and doc pickle loader functions

* Set up mypy
@mschoettle
Copy link

mschoettle commented Feb 28, 2022

It would probably be good to pin the exact bandit version in the requirements of this plugin to avoid a similar situation in the future. Not sure how exactly right now but happy to provide a PR if @tylerwince agrees.

@Dreamsorcerer
Copy link

Dreamsorcerer commented Mar 1, 2022

This looks like a very low-activity project, so I'd suspect that will only work if someone sets up dependabot to automatically update the dependency and then automatically deploy a new release at the same time, if the tests pass successfully.

nastra added a commit to nastra/flake8-bandit that referenced this issue Mar 1, 2022
Fixes tylerwince#21

flake8-bandit 1.7.3 (PyCQA/bandit#496)
introduced an `fdata` argument and this just passes a `None` to make
things work with the latest version of bandit.
sosy-bot pushed a commit to sosy-lab/cpachecker that referenced this issue Mar 1, 2022
@dolfinus
Copy link

dolfinus commented Mar 1, 2022

It would probably be good to pin the exact bandit version

This is not a good idea for a library. In such a case user will not be able to install another library which requires some other bandit version, as well as just upgrade bandit because some issue was fixed or a new feature was introduced.

If flake8-bandit requires some changes were added only to bandit==1.7.3, requirements.txt should look like bandit>=1.7.3. This allows user to install any other new version of bandit if this is required.

There is a way to protect from issues with future bandit releases - set up upper limit for bandit version, like bandit>=1.7.3,<2.0 or even bandit>=1.7.3,<1.8. But this requires flake8-bandit to release more often.

Also there is no guarantee that 1.7.4 release will not break backward compatibility. Actually, instead of 1.7.3 version PyCQA/bandit#496 commit should be released as 1.8.0 because it caused backward compatibility break in the first place.

smarie pushed a commit to smarie/python-decopatch that referenced this issue Mar 1, 2022
silasary added a commit to NAFTeam/NAFF that referenced this issue Mar 1, 2022
Temporary measure until tylerwince/flake8-bandit#21 is resolved
nastra added a commit to nastra/flake8-bandit that referenced this issue Mar 1, 2022
Fixes tylerwince#21

flake8-bandit 1.7.3 (PyCQA/bandit#496)
introduced an `fdata` argument and this just passes a `None` to make
things work with the latest version of bandit.
@pawamoy
Copy link

pawamoy commented Mar 1, 2022

There is a way to protect from issues with future bandit releases - set up upper limit for bandit version, like bandit>=1.7.3,<2.0 or even bandit>=1.7.3,<1.8.

Disagree as well, for the reasons you mentioned:

But this requires flake8-bandit to release more often.
Also there is no guarantee that 1.7.4 release will not break backward compatibility.

Compatibility can be broken at any time indeed. Upper bounds do not protect your library. And they prevent downstream users to get upgrades. Without upper bounds, sure, things can break more often, but users can exclude the problematic version themselves. Then upstream can either fix the compatibility issue or exclude the version as well.

Upper bounds can still be used of course, but only if you know the excluded range broke or is going to break compatiblity.

nastra added a commit to nastra/flake8-bandit that referenced this issue Mar 1, 2022
Fixes tylerwince#21

flake8-bandit 1.7.3 (PyCQA/bandit#496)
introduced an `fdata` argument and this just passes a `None` to make
things work with the latest version of bandit.
@dhuckins
Copy link

dhuckins commented Mar 1, 2022

is @tylerwince still watching this repo?
doesn't seem like its been updated in a few years
does anyone else have access to merge a change and deploy?

@tylerwince
Copy link
Owner

Hey all! I'm happy to update and add a dependabot and accept PRs on this.

Let me take a look at the PR that was opened this morning and I'll try to work on it later today.

konstruktoid added a commit to konstruktoid/action-pylint that referenced this issue Mar 8, 2022
Signed-off-by: Thomas Sjögren <konstruktoid@users.noreply.github.com>
bisho added a commit to RevenueCat/meta-memcache-py that referenced this issue Mar 8, 2022
## Motivation / Description
See tylerwince/flake8-bandit#21

## Changes introduced
- pin bandit version
@tylerwince
Copy link
Owner

Sorry all! Been crazy the last week at work but this should be resolved! Let me know if you see anything that isn't working right! Cheers and thanks for being patient.

@pawamoy
Copy link

pawamoy commented Mar 8, 2022

Thank you for your time @tylerwince 🙂

@radomirbosak
Copy link

Thank you very much for fixing this! :)

Would it be also possible do a new flake8-bandit release to pypi?

@RemyLau
Copy link
Author

RemyLau commented Mar 9, 2022

Thanks a lot!

bisho added a commit to RevenueCat/meta-memcache-py that referenced this issue Mar 9, 2022
## Motivation / Description
See tylerwince/flake8-bandit#21

## Changes introduced
- pin bandit version
@Zethson
Copy link

Zethson commented Mar 9, 2022

@tylerwince thank you! I think that for this to propagate properly we need a new release on PyPI. Would appreciate it!

tueda added a commit to tueda/PS2022SS that referenced this issue Mar 11, 2022
rsundqvist added a commit to rsundqvist/rics that referenced this issue Mar 11, 2022
- Relax a bunch of overly-zealous linter args
- Ignore missing AssertionError in docstrings
- Lock down bandit (see: tylerwince/flake8-bandit#21)
- Disable strict optional
- Ignore missing stubs from third-party libraries pandas,tqdm,sqlalchemy
- Update lockfile
- Remove unused module
- Basic logging configuration (null handler)

Notebooks:
- Add formatting of notebooks
- Add run-jupyter.sh convenience script (nosec)
- Add PerfTestTemplate.ipynb
rsundqvist added a commit to rsundqvist/rics that referenced this issue Mar 11, 2022
- Relax a bunch of overly-zealous linter args
- Ignore missing AssertionError in docstrings
- Lock down bandit (see: tylerwince/flake8-bandit#21)
- Disable strict optional
- Ignore missing stubs from third-party libraries pandas,tqdm,sqlalchemy
- Update lockfile
- Remove unused module
- Basic logging configuration (null handler)

Notebooks:
- Add formatting of notebooks
- Add run-jupyter.sh convenience script (nosec)
- Add PerfTestTemplate.ipynb
rsundqvist added a commit to rsundqvist/rics that referenced this issue Mar 11, 2022
Too much stuff to list here..

Partial changes:
- Relax a bunch of overly-zealous linter args
- Ignore missing AssertionError in docstrings
- Lock down bandit (see: tylerwince/flake8-bandit#21)
- Disable strict optional
- Ignore missing stubs from third-party libraries pandas,tqdm,sqlalchemy
- Update lockfile
- Remove unused module
- Basic logging configuration (null handler)
- Use Poetry 1.2.0.a2 for builds

Notebooks:
- Add formatting of notebooks
- Add run-jupyter.sh convenience script (nosec)
- Add PerfTestTemplate.ipynb
rsundqvist added a commit to rsundqvist/rics that referenced this issue Mar 11, 2022
Too much stuff to list here..

Partial changes:
- Relax a bunch of overly-zealous linter args
- Ignore missing AssertionError in docstrings
- Lock down bandit (see: tylerwince/flake8-bandit#21)
- Disable strict optional
- Ignore missing stubs from third-party libraries pandas,tqdm,sqlalchemy
- Update lockfile
- Remove unused module
- Basic logging configuration (null handler)
- Use Poetry 1.2.0.a2 for builds

Notebooks:
- Add formatting of notebooks
- Add run-jupyter.sh convenience script (nosec)
- Add PerfTestTemplate.ipynb
rsundqvist added a commit to rsundqvist/rics that referenced this issue Mar 11, 2022
Too much stuff to list here..

Partial changes:
- Relax a bunch of overly-zealous linter args
- Ignore missing AssertionError in docstrings
- Lock down bandit (see: tylerwince/flake8-bandit#21)
- Disable strict optional
- Ignore missing stubs from third-party libraries pandas,tqdm,sqlalchemy
- Update lockfile
- Remove unused module
- Basic logging configuration (null handler)
- Use Poetry 1.2.0.a2 for builds

Notebooks:
- Add formatting of notebooks
- Add run-jupyter.sh convenience script (nosec)
- Add PerfTestTemplate.ipynb
rsundqvist added a commit to rsundqvist/rics that referenced this issue Mar 11, 2022
Too much stuff to list here..

Partial changes:
- Relax a bunch of overly-zealous linter args
- Ignore missing AssertionError in docstrings
- Lock down bandit (see: tylerwince/flake8-bandit#21)
- Disable strict optional
- Ignore missing stubs from third-party libraries pandas,tqdm,sqlalchemy
- Update lockfile
- Remove unused module
- Basic logging configuration (null handler)
- Use Poetry 1.2.0.a2 for builds

Notebooks:
- Add formatting of notebooks
- Add run-jupyter.sh convenience script (nosec)
- Add PerfTestTemplate.ipynb
rsundqvist added a commit to rsundqvist/rics that referenced this issue Mar 11, 2022
Too much stuff to list here..

Partial changes:
- Relax a bunch of overly-zealous linter args
- Ignore missing AssertionError in docstrings
- Lock down bandit (see: tylerwince/flake8-bandit#21)
- Disable strict optional
- Ignore missing stubs from third-party libraries pandas,tqdm,sqlalchemy
- Update lockfile
- Remove unused module
- Basic logging configuration (null handler)
- Use Poetry 1.2.0.a2 for builds

Notebooks:
- Add formatting of notebooks
- Add run-jupyter.sh convenience script (nosec)
- Add PerfTestTemplate.ipynb
rsundqvist added a commit to rsundqvist/rics that referenced this issue Mar 11, 2022
Too much stuff to list here..

Partial changes:
- Relax a bunch of overly-zealous linter args
- Ignore missing AssertionError in docstrings
- Lock down bandit (see: tylerwince/flake8-bandit#21)
- Disable strict optional
- Ignore missing stubs from third-party libraries pandas,tqdm,sqlalchemy
- Update lockfile
- Remove unused module
- Basic logging configuration (null handler)
- Use Poetry 1.2.0.a2 for builds

Notebooks:
- Add formatting of notebooks
- Add run-jupyter.sh convenience script (nosec)
- Add PerfTestTemplate.ipynb
rsundqvist added a commit to rsundqvist/rics that referenced this issue Mar 11, 2022
Too much stuff to list here..

Partial changes:
- Relax a bunch of overly-zealous linter args
- Ignore missing AssertionError in docstrings
- Lock down bandit (see: tylerwince/flake8-bandit#21)
- Disable strict optional
- Ignore missing stubs from third-party libraries pandas,tqdm,sqlalchemy
- Update lockfile
- Remove unused module
- Basic logging configuration (null handler)
- Use Poetry 1.2.0.a2 for builds

Notebooks:
- Add formatting of notebooks
- Add run-jupyter.sh convenience script (nosec)
- Add PerfTestTemplate.ipynb
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet