fix(http): close the wrapped async transport - #734
Open
RKS (rksharma-owg) wants to merge 1 commit into
Open
RKS (rksharma-owg) wants to merge 1 commit into
RKS (rksharma-owg) wants to merge 1 commit into
Conversation
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Closing a client created by
KiotaClientFactorycurrently leaves its underlying transport open.AsyncKiotaTransportinherits the no-opAsyncBaseTransport.aclose(), so both explicit client closure and async context exit stop at the wrapper.Delegate
aclose()to the wrapped transport. This restores the HTTPX client lifecycle contract without changing request processing or credential ownership. Cleanup exceptions propagate to the caller.Validation on Python 3.13.14:
pytest -q tests/test_kiota_client_factory.py: 15 passed.pytest -q: 115 passed; upstream baseline was 110 passed.yapf -dr kiota_http,mypy kiota_http, andgit diff --check: passed. Mypy checked 24 source files.pylint kiota_http --disable=W --rcfile=.pylintrc: exit 0, 10/10, with the existing unrecognizedsuggestion-modeoption diagnostic.isort kiota_http: exit 0. A supplementary--check-onlyrun identifies one existing blank-line issue in untouchedredirect_handler_option.py, also reproduced from the upstream file. No unrelated formatting change is included; the changed implementation passes the import check.uv build --wheel --out-dir <external-artifacts-directory>: passed.Tests use in-memory transports and no live credentials or external HTTP service. Other Python versions and platforms were not run locally.
Closes #494.
Prepared with AI assistance; reproduction and validation ran locally.