From 5f61b541aeca70a9f66f5d7486266005bdcbaa1e Mon Sep 17 00:00:00 2001 From: Akash Ayare Date: Thu, 14 May 2026 01:12:45 -0700 Subject: [PATCH 1/2] Define unit test to verify urllib3 FutureWarning Signed-off-by: Akash Ayare --- tests/unit/test_base_client.py | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 tests/unit/test_base_client.py diff --git a/tests/unit/test_base_client.py b/tests/unit/test_base_client.py new file mode 100644 index 0000000000..210f3c86d6 --- /dev/null +++ b/tests/unit/test_base_client.py @@ -0,0 +1,23 @@ +# coding: utf-8 +# Copyright (c) 2016, 2026, Oracle and/or its affiliates. All rights reserved. +# This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. + +import warnings + +from oci.base_client import OCIHTTPAdapter + + +def test_oci_http_adapter_does_not_emit_urllib3_strict_future_warning(): + with warnings.catch_warnings(record=True) as caught_warnings: + warnings.simplefilter("always", FutureWarning) + + adapter = OCIHTTPAdapter() + adapter.poolmanager.connection_from_url("https://objectstorage.us-phoenix-1.oraclecloud.com") + + strict_future_warnings = [ + warning for warning in caught_warnings + if issubclass(warning.category, FutureWarning) and + "'strict' parameter is no longer needed" in str(warning.message) + ] + + assert strict_future_warnings == [] From cfd8d2c2a1c86f88fabb2c481c40dde57a5edfb8 Mon Sep 17 00:00:00 2001 From: Akash Ayare Date: Thu, 14 May 2026 01:17:36 -0700 Subject: [PATCH 2/2] Address urllib3 FutureWarning for strict parameter With oci v2.174.0 and urllib3 v2.7.0 there is an annoying warning message created by urllib3. This warning can be resolved by removing the use of the strict parameter from OCIHTTPAdapter. Signed-off-by: Akash Ayare --- src/oci/base_client.py | 1 - 1 file changed, 1 deletion(-) diff --git a/src/oci/base_client.py b/src/oci/base_client.py index 1b7b449844..d4c978f699 100644 --- a/src/oci/base_client.py +++ b/src/oci/base_client.py @@ -374,7 +374,6 @@ def init_poolmanager(self, connections, maxsize, block=requests.adapters.DEFAULT num_pools=connections, maxsize=maxsize, block=block, - strict=True, **pool_kwargs )