Skip to content

Fix urllib3 strict parameter warning#867

Open
action wants to merge 2 commits into
oracle:masterfrom
action:fix-urllib3-strict-parameter-warning
Open

Fix urllib3 strict parameter warning#867
action wants to merge 2 commits into
oracle:masterfrom
action:fix-urllib3-strict-parameter-warning

Conversation

@action
Copy link
Copy Markdown

@action action commented May 14, 2026

With oci v2.174.0 and urllib3 v2.7.0 we get an annoying FutureWarning hinting to us that the strict parameter is no longer needed.

Demonstrate Warning

Sample script:

$ cat warning.py
import oci

default_config = oci.config.from_file()
client = oci.object_storage.ObjectStorageClient(default_config)
try:
    client.list_buckets(compartment_id="foo", namespace_name="bar")
except oci.exceptions.ServiceError:
    pass

Result:

$ uv run warning.py
/home/akash/workspace/oci-python-sdk/.venv/lib/python3.12/site-packages/urllib3/poolmanager.py:329: FutureWarning: The 'strict' parameter is no longer needed on Python 3+. This will raise an error in urllib3 v3.0.
  warnings.warn(

Proposed Solution

In OCIHTTPAdapter we can delete the strict=True parameter, because we have been informed that it is no longer needed.

Execute Unit Test

$ PYTHONWARNINGS=always uv run --with pytest python -m pytest tests/unit/test_base_client.py -v --confcutdir=tests/unit
================================================================================= test session starts ==================================================================================
platform linux -- Python 3.12.3, pytest-9.0.3, pluggy-1.6.0 -- /home/akash/.cache/uv/builds-v0/.tmpCZVuIJ/bin/python
cachedir: .pytest_cache
rootdir: /home/akash/workspace/oci-python-sdk
configfile: pyproject.toml
collected 1 item                                                                                                                                                                       

tests/unit/test_base_client.py::test_oci_http_adapter_does_not_emit_urllib3_strict_future_warning PASSED                                                                         [100%]

================================================================================== 1 passed in 0.32s ===================================================================================

Environment

$ uv pip show oci | grep Version
Version: 2.174.0


$ uv pip show urllib3 | grep Version
Version: 2.7.0

action added 2 commits May 14, 2026 01:34
Signed-off-by: Akash Ayare <akash.ayare@oracle.com>
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 <akash.ayare@oracle.com>
@oracle-contributor-agreement
Copy link
Copy Markdown

Thank you for your pull request and welcome to our community! To contribute, please sign the Oracle Contributor Agreement (OCA).
The following contributors of this PR have not signed the OCA:

To sign the OCA, please create an Oracle account and sign the OCA in Oracle's Contributor Agreement Application.

When signing the OCA, please provide your GitHub username. After signing the OCA and getting an OCA approval from Oracle, this PR will be automatically updated.

If you are an Oracle employee, please make sure that you are a member of the main Oracle GitHub organization, and your membership in this organization is public.

@oracle-contributor-agreement oracle-contributor-agreement Bot added the OCA Required At least one contributor does not have an approved Oracle Contributor Agreement. label May 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

OCA Required At least one contributor does not have an approved Oracle Contributor Agreement.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant