diff options
| author | robot-piglet <[email protected]> | 2025-08-01 00:01:09 +0300 |
|---|---|---|
| committer | robot-piglet <[email protected]> | 2025-08-01 00:11:46 +0300 |
| commit | 75fd1fc757cc04e434a65784ae4ba6e28350878d (patch) | |
| tree | def4a4c6e8a93c0f37b563a6bb86bc7936fc3912 /contrib/python/clickhouse-connect/clickhouse_connect/driver/httputil.py | |
| parent | f5d4ccd1e8d8054636ee31f953767a529801fcbf (diff) | |
Intermediate changes
commit_hash:11a36b37f1d393ab351897e8a0b5bf4de5871fe0
Diffstat (limited to 'contrib/python/clickhouse-connect/clickhouse_connect/driver/httputil.py')
| -rw-r--r-- | contrib/python/clickhouse-connect/clickhouse_connect/driver/httputil.py | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/contrib/python/clickhouse-connect/clickhouse_connect/driver/httputil.py b/contrib/python/clickhouse-connect/clickhouse_connect/driver/httputil.py index 859c7d88ba8..37bb24e616e 100644 --- a/contrib/python/clickhouse-connect/clickhouse_connect/driver/httputil.py +++ b/contrib/python/clickhouse-connect/clickhouse_connect/driver/httputil.py @@ -55,10 +55,10 @@ def close_managers(): def get_pool_manager_options(keep_interval: int = DEFAULT_KEEP_INTERVAL, keep_count: int = DEFAULT_KEEP_COUNT, keep_idle: int = DEFAULT_KEEP_IDLE, - ca_cert: str = None, + ca_cert: Optional[str] = None, verify: bool = True, - client_cert: str = None, - client_cert_key: str = None, + client_cert: Optional[str] = None, + client_cert_key: Optional[str] = None, **options) -> Dict[str, Any]: socket_options = core_socket_options.copy() if getattr(socket, 'TCP_KEEPINTVL', None) is not None: @@ -88,12 +88,12 @@ def get_pool_manager_options(keep_interval: int = DEFAULT_KEEP_INTERVAL, def get_pool_manager(keep_interval: int = DEFAULT_KEEP_INTERVAL, keep_count: int = DEFAULT_KEEP_COUNT, keep_idle: int = DEFAULT_KEEP_IDLE, - ca_cert: str = None, + ca_cert: Optional[str] = None, verify: bool = True, - client_cert: str = None, - client_cert_key: str = None, - http_proxy: str = None, - https_proxy: str = None, + client_cert: Optional[str] = None, + client_cert_key: Optional[str] = None, + http_proxy: Optional[str] = None, + https_proxy: Optional[str] = None, **options): options = get_pool_manager_options(keep_interval, keep_count, @@ -228,12 +228,13 @@ class ResponseSource: read_gen = response.stream(chunk_size, decompress is None) while True: while not done: + chunk = None try: chunk = next(read_gen, None) # Always try to read at least one chunk if there are any left except Exception: # pylint: disable=broad-except # By swallowing an unexpected exception reading the stream, we will let consumers decide how to # handle the unexpected end of stream - pass + logger.warning('unexpected failure to read next chunk', exc_info=True) if not chunk: done = True break |
