From a9a349f1d31256a81a41f3f9b91b8473e464923b Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Mon, 15 May 2023 13:12:25 -0500 Subject: [PATCH] Re-enable cleanup_closed on cpython >= 3.11.4 The problem that caused us to turn this off has been fixed upstream in 3.11.4 https://github.com/python/cpython/pull/104485 --- homeassistant/helpers/aiohttp_client.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/homeassistant/helpers/aiohttp_client.py b/homeassistant/helpers/aiohttp_client.py index 78806cb5ae174c..8208c774887010 100644 --- a/homeassistant/helpers/aiohttp_client.py +++ b/homeassistant/helpers/aiohttp_client.py @@ -37,10 +37,11 @@ APPLICATION_NAME, __version__, aiohttp.__version__, sys.version_info ) -ENABLE_CLEANUP_CLOSED = sys.version_info < (3, 11, 1) +ENABLE_CLEANUP_CLOSED = not (3, 11, 1) <= sys.version_info < (3, 11, 4) # Enabling cleanup closed on python 3.11.1+ leaks memory relatively quickly # see https://github.com/aio-libs/aiohttp/issues/7252 # aiohttp interacts poorly with https://github.com/python/cpython/pull/98540 +# The issue was fixed in 3.11.4 via https://github.com/python/cpython/pull/104485 WARN_CLOSE_MSG = "closes the Home Assistant aiohttp session"