Skip to content

No need to check httpx client without timeout defined#1177

Merged
ericwb merged 3 commits into
PyCQA:mainfrom
ericwb:httpx_no_timeout
Oct 14, 2024
Merged

No need to check httpx client without timeout defined#1177
ericwb merged 3 commits into
PyCQA:mainfrom
ericwb:httpx_no_timeout

Conversation

@ericwb
Copy link
Copy Markdown
Member

@ericwb ericwb commented Sep 27, 2024

Unlike python-requests, the httpx client has a default timeout of 5 seconds on its class and functions. As such, there is no need for Bandit to check for an undefined timeout. However, explicitly setting the timeout to None is still a potential problem as that would create a situtation where the client would block forever.

Fixes: #1175

Unlike python-requests, the httpx client has a default
timeout of 5 seconds on its class and functions. As such,
there is no need for Bandit to check for an undefined
timeout. However, explicitly setting the timeout to None
is still a potential problem as that would create a
situtation where the client would block forever.

Fixes: PyCQA#1175

Signed-off-by: Eric Brown <eric_wade_brown@yahoo.com>
@ericwb ericwb merged commit 071386b into PyCQA:main Oct 14, 2024
@ericwb ericwb deleted the httpx_no_timeout branch October 14, 2024 16:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

"Call to httpx without timeout" when httpx has timeout by default

2 participants