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

Adjust positional arguments flagged by flake8-bugbear #953

Merged
merged 1 commit into from
Nov 29, 2023

Conversation

ccostino
Copy link
Contributor

@ccostino ccostino commented Nov 28, 2023

The new release of flake8-bugbear is starting to flag positional argument unpacking that comes after keyword arguments in function calls as a style warning that fails. This is a good thing to catch because it can lead to unexpected side effects with function arguments and/or errors thrown by Python.

See the following links for more details:

This changeset fixes a couple of instances where the positional argument unpacking was happening after keyword arguments were being provided. I've tested these changes both before and after updating the flake8-bugbear dependency locally, and the site loads fine and the tests all pass.

Security Considerations

  • Helps prevent bugs from being exploited in our code.

@ccostino ccostino added engineering dependencies Pull requests that update a dependency file bug labels Nov 28, 2023
@ccostino ccostino self-assigned this Nov 28, 2023
The new release of flake8-bugbear is starting to flag positional argument unpacking that comes after keyword arguments in function calls as a style warning that fails.  This is a good thing to catch because it can lead to unexpected side effects with function arguments and/or errors thrown by Python.

See the following links for more details:

- https://stackoverflow.com/questions/58961715/python-value-unpacking-order-in-method-parameters
- python/cpython#82741

This changeset fixes a couple of instances where the positional argument unpacking was happening after keyword arguments were being provided.

Signed-off-by: Carlo Costino <carlo.costino@gsa.gov>
@stvnrlly stvnrlly merged commit f392c67 into main Nov 29, 2023
6 checks passed
@stvnrlly stvnrlly deleted the fix-positional-arguments branch November 29, 2023 14:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug dependencies Pull requests that update a dependency file engineering
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

2 participants