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

Drop await aiohttp.request(...) #2540

Closed
asvetlov opened this issue Nov 20, 2017 · 1 comment · Fixed by #2541 or #2543
Closed

Drop await aiohttp.request(...) #2540

asvetlov opened this issue Nov 20, 2017 · 1 comment · Fixed by #2541 or #2543

Comments

@asvetlov
Copy link
Member

Closing request/session is too error-prone in the case, especially if an exception was generated.

The only robust solution is prohibiting await request() syntax but supporting async with request() as resp: only.

After implementing proposed restriction we'll get very clean context and behavior.

@asvetlov asvetlov added this to the 3.0 milestone Nov 20, 2017
asvetlov added a commit that referenced this issue Nov 21, 2017
* Get rid of more yield froms

* Fix #2540: Drop await aiohttp.request() syntax for sake of context manager

* Fix typo

* Work on dropping Python 3.4 functionality

* Fix typo

* Fix flake8

* Fix spelling

* Code cleanup
@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].
[new issue]: https://github.com/aio-libs/aiohttp/issues/new

@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.
Projects
None yet
1 participant