Skip to content

fix(http): conditionally pass enable_cleanup_closed for older Python - #3909

Open
user-Param wants to merge 4 commits into
ApeWorX:mainfrom
user-Param:fix/3900-aiohttp-cleanup-closed
Open

user-Param wants to merge 4 commits into
ApeWorX:mainfrom
user-Param:fix/3900-aiohttp-cleanup-closed

Conversation

@user-Param

Copy link
Copy Markdown

Fixes #3900 - AsyncHTTPProvider was passing enable_cleanup_closed=True unconditionally, triggering a DeprecationWarning on Python 3.12.8+ and 3.13.1+. The fix only passes the flag on older Python versions where the CPython bug #118960 is not fixed.

@user-Param

Copy link
Copy Markdown
Author

All tests pass and the fix addresses a real issue. Would appreciate a review!

…peWorX#3900)

Only pass enable_cleanup_closed=True to aiohttp's TCPConnector on Python
versions that need it (< 3.12.8 or 3.13.x < 3.13.1). On newer versions,
aiohttp ignores the parameter and emits a DeprecationWarning, which breaks
tests run with -W error.

Fixes ApeWorX#3900.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

aiohttp DeprecationWarning for enable_cleanup_closed on Python 3.12.8+ / 3.13.1+

2 participants