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

ClientSession.__aexit__ synchronous session close #2063

Closed
litwisha opened this issue Jul 6, 2017 · 3 comments
Closed

ClientSession.__aexit__ synchronous session close #2063

litwisha opened this issue Jul 6, 2017 · 3 comments
Labels

Comments

@litwisha
Copy link
Contributor

litwisha commented Jul 6, 2017

Long story short

When using ClientSession as an asynchronous context manager, self.close is not awaited and it throws DeprecationWarning.

Expected behaviour

Returns self.close() in ClientSession.__aexit__

Actual behaviour

Calls self.close() in ClientSession.__aexit__

Steps to reproduce

import asyncio
from aiohttp import ClientSession

loop = asyncio.get_event_loop()


async def coro():
    async with ClientSession(loop=loop):
        pass


loop.run_until_complete(coro())

Your environment

OS X 10.12.3
python 3.6.0
aiohttp==2.2.3
@litwisha litwisha changed the title ClientSession.__aexit__ session is closed not correct ClientSession.__aexit__ synchronous session close Jul 6, 2017
@asvetlov
Copy link
Member

Fixed by #2064

@asvetlov
Copy link
Member

Thanks!

@lock
Copy link

lock bot commented Oct 28, 2019

This thread has been automatically locked since there has not been
any recent activity after it was closed. Please open a new issue for
related bugs.

If you feel like there's important points made in this discussion,
please include those exceprts into that new issue.

@lock lock bot added the outdated label Oct 28, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Oct 28, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants