[flake8-bandit] flag S501 with requests.request#23873
Merged
amyreese merged 1 commit intoastral-sh:mainfrom Mar 11, 2026
Merged
[flake8-bandit] flag S501 with requests.request#23873amyreese merged 1 commit intoastral-sh:mainfrom
flake8-bandit] flag S501 with requests.request#23873amyreese merged 1 commit intoastral-sh:mainfrom
Conversation
Just added "request" in the field of possible function call in the requests module Added some tests also. They shift the results a bit, so the snapshot looks like it changed a lot but actually it mostly just line numbers
|
| code | total | + violation | - violation | + fix | - fix |
|---|---|---|---|---|---|
| S501 | 1 | 1 | 0 | 0 | 0 |
Linter (preview)
ℹ️ ecosystem check detected linter changes. (+1 -0 violations, +0 -0 fixes in 1 projects; 55 projects unchanged)
indico/indico (+1 -0 violations, +0 -0 fixes)
ruff check --no-cache --exit-zero --no-fix --output-format concise --preview
+ bin/utils/apiProxy.py:46:78: S501 Probable use of `requests` call with `verify=False` disabling SSL certificate checks
Changes by rule (1 rules affected)
| code | total | + violation | - violation | + fix | - fix |
|---|---|---|---|---|---|
| S501 | 1 | 1 | 0 | 0 | 0 |
amyreese
approved these changes
Mar 11, 2026
Member
|
@ntBre do you think this needs to be preview gated? there's only one ecosystem report, so I personally wouldn't be worried about it, but wanted to check with you. |
Contributor
|
I was wondering about that myself. I think it's probably okay without preview. It feels reasonably like a bug fix since it's well within the spirit of the rule and seems like just an oversight. |
flake8-bandit] flag S501 with requests.request
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fix 23735: S501 not raised when calling requests.request (instead of requests.get, requests.post, ...)
Changes
Very minimal changes.
Just added "request" in the field of possible function call in the requests module.
Test plan
Tests were updated, I added calls with requests.request and
verify = false/verify = true, according to the previous tests.