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

Missing raise_for_status parameter to aiohttp.request #3290

Closed
artslob opened this issue Sep 24, 2018 · 4 comments
Closed

Missing raise_for_status parameter to aiohttp.request #3290

artslob opened this issue Sep 24, 2018 · 4 comments

Comments

@artslob
Copy link
Contributor

artslob commented Sep 24, 2018

Missing raise_for_status parameter to aiohttp.request

Well the title stands for itself.
Documentation on aiohttp.request stands, that this method have argument raise_for_status, which was added in version 3.4.
But looking into current code of file aiohttp.client.py shows that this method do not have such argument.

Expected behaviour

Expected that this code will work like a charm:

import aiohttp
async with aiohttp.request('GET', 'www.example.com', raise_for_status=True, ) as response:
    pass

Actual behaviour

Get type error:

TypeError: request() got an unexpected keyword argument 'raise_for_status'

Steps to reproduce

import aiohttp
import asyncio

async def fetch():
    async with aiohttp.request('GET', 'http://python.org/', raise_for_status=True) as resp:
        assert resp.status == 200
        print(resp.status)

if __name__ == '__main__':
    loop = asyncio.get_event_loop()
    loop.run_until_complete(fetch())

Your environment

aiohttp==3.4.4
Client

@asvetlov
Copy link
Member

GitMate.io thinks possibly related issues are #432 (asyncio.wait_for throwing a timeout error on aiohttp.request?), #168 (aiohttp.web missing), #1403 ([QUESTION] aiohttp.ClientSession.request('GET') issue), #2878 (Add argument 'raise_for_status' to 'ClientSession' request method.), and #2920 (AIOHttp failing after some requests).

@asvetlov
Copy link
Member

Makes sense.
Would you provide a Pull Request?

@artslob
Copy link
Contributor Author

artslob commented Sep 27, 2018

Yep. Will try to do something on this holidays

@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
Development

No branches or pull requests

2 participants