Skip to content

Missing raise_for_status parameter to aiohttp.request #3290

@artslob

Description

@artslob

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions