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

Fix: force timeouts to integer types #226

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion redshift_connector/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -626,7 +626,7 @@ def get_calling_module() -> str:
raise ProgrammingError("one of host or unix_sock must be provided")
if timeout is not None:
_logger.debug("set socket timeout=%s", timeout)
self._usock.settimeout(timeout)
self._usock.settimeout(int(timeout))

if unix_sock is None and host is not None:
hostport: typing.Tuple[str, int] = Connection.__get_host_address_info(host, port)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ def check_required_parameters(self: "BrowserAzureOAuth2CredentialsProvider") ->
BrowserAzureOAuth2CredentialsProvider.handle_missing_required_property("idp_tenant")
if not self.client_id:
BrowserAzureOAuth2CredentialsProvider.handle_missing_required_property("client_id")
if not self.idp_response_timeout or self.idp_response_timeout < 10:
if not self.idp_response_timeout or int(self.idp_response_timeout) < 10:
BrowserAzureOAuth2CredentialsProvider.handle_invalid_property_value(
"idp_response_timeout", "Must be 10 seconds or greater"
)
Expand Down