-
Couldn't load subscription status.
- Fork 21
Open
Description
On Textual 6.4 and textual-dev==1.8.0, running Harlequin with:
uv run textual run --dev -c harlequinUpon exit, this error is printed:
Unclosed client session
client_session: <aiohttp.client.ClientSession object at 0x7efee5140cd0>
Adding the following code before starting the Textual app lets us see the source of the unclosed session:
import asyncio
import warnings
import tracemalloc
tracemalloc.start()
asyncio.get_event_loop().set_debug(True)
warnings.simplefilter("always", ResourceWarning)That points to the client module in this package:
/home/tco/open/harlequin/.venv/lib/python3.10/site-packages/aiohttp/client.py:453: ResourceWarning: Unclosed client session <aiohttp.client.ClientSession object at 0x7fbe51bbc2b0>
_warnings.warn(
Object allocated at (most recent call last):
File "/home/tco/open/harlequin/.venv/lib/python3.10/site-packages/textual_dev/client.py", lineno 114
self.session = aiohttp.ClientSession()
Unclosed client session
client_session: <aiohttp.client.ClientSession object at 0x7fbe51bbc2b0>
textual-dev/src/textual_dev/client.py
Line 114 in e563f96
| self.session = aiohttp.ClientSession() |
changing that assignment to a context manager should do the trick. PR incoming.
Metadata
Metadata
Assignees
Labels
No labels