Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

warning "was never awaited" when using README example #4

Open
sarah-github opened this issue Sep 21, 2022 · 1 comment
Open

warning "was never awaited" when using README example #4

sarah-github opened this issue Sep 21, 2022 · 1 comment

Comments

@sarah-github
Copy link

sarah-github commented Sep 21, 2022

Hi,
when using the example from your README, the following warning occurs:

uplink_httpx/client.py:39: RuntimeWarning: coroutine 'AsyncClient.aclose' was never awaited pass RuntimeWarning: Enable tracemalloc to get the object allocation traceback

This is concerning the line

asyncio.create_task(self._session.aclose())

in client.py, the self._session.aclose() should be awaited, but then, also the whole __del__ function has to be async which creates further needs of changes. Is this because of newer versions of uplink and httpx, since the example was created?

@sarah-github
Copy link
Author

Not sure, if it's the proper solution, but asyncio.run instead of asyncio.create_task avoids the warning.

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

No branches or pull requests

1 participant