Skip to content

Conversation

@umoshamm
Copy link

@umoshamm umoshamm commented Sep 4, 2025

updated api.py function send_api_request to pass the timeout parameter to the urlopen function instead of the Request object.

…ter to the urlopen function instead of the Request object.

try:
resp = ul.urlopen(req, context=ctx)
if self.timeout:
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we want to check if the timeout is set before passing it?
urlopen uses the socket's global default which, according to the docs, is None by default.

So IMO, we don't need to be defensive here and just pass the timeout, no matter what.

NOTE: I am not affiliated with zabbix_utils, merely a user of the project.

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.

2 participants