fix: conditionally pass enable_cleanup_closed to aiohttp TCPConnector#17367
Merged
2 commits merged intoBerriAI:mainfrom Dec 3, 2025
Merged
Conversation
Fixes deprecation warning on Python 3.12.7+ and 3.13.1+ where enable_cleanup_closed is no longer needed since the underlying CPython SSL connection leak bug was fixed. See: python/cpython#118960
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Contributor
|
@Joilence it looks like not merged by conflict |
This pull request was closed.
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.
Title
fix: conditionally pass enable_cleanup_closed to aiohttp TCPConnector
Relevant issues
N/A (addresses deprecation warning, no existing issue)
Pre-Submission checklist
I have Added testing in the
tests/litellm/directory, Adding at least 1 test is a hard requirementChange is trivial and dependent on python versions, please let me know if still need to add tests.
I have added a screenshot of my new test passing locally - N/A
My PR passes all unit tests on
make test-unit- No new tests added; existing tests unaffectedMy PR's scope is as isolated as possible, it only solves 1 specific problem
Type
🐛 Bug Fix
Changes
To avoid warning:
Fixes deprecation warning on Python 3.12.7+ and 3.13.1+ where
enable_cleanup_closedis no longer needed.AIOHTTP_NEEDS_CLEANUP_CLOSEDconstant tolitellm/constants.pythat evaluates toTrueonly on Python versions with the SSL leak bug (< 3.12.7 or exactly 3.13.0), aiohttp source:NEEDS_CLEANUP_CLOSEDin connector.py#L74-L78litellm/llms/custom_httpx/http_handler.pyto use the new constantlitellm/proxy/proxy_server.pyto use the new constant