From 4c53c6d1877ea748ca0a37f0dbb082277ed0bb57 Mon Sep 17 00:00:00 2001 From: Abe Hanoka Date: Fri, 11 Jul 2025 11:59:25 -0400 Subject: Fix timeout type hint in RequestsClient (#1537) The `RequestsClient`'s `__init__` method incorrectly typed the `timeout` parameter as `int`. The underlying `requests` library accepts a float for a total timeout or a `(connect_timeout, read_timeout)` tuple. This commit updates the type hint to `Union[float, Tuple[float, float]]` to accurately reflect the timeout in the requests library. https://github.com/psf/requests/blob/91a3eabd3dcc4d7f36dd8249e4777a90ef9b4305/src/requests/sessions.py#L538 --- stripe/_http_client.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stripe/_http_client.py b/stripe/_http_client.py index 5a1b6981..b5421424 100644 --- a/stripe/_http_client.py +++ b/stripe/_http_client.py @@ -595,7 +595,7 @@ class RequestsClient(HTTPClient): def __init__( self, - timeout: int = 80, + timeout: Union[float, Tuple[float, float]] = 80, session: Optional["RequestsSession"] = None, verify_ssl_certs: bool = True, proxy: Optional[Union[str, HTTPClient._Proxy]] = None, -- cgit v1.2.3