Skip to content

aiohttp>2.0.3 streaming api critical bug #1981

Closed
@Rybak5611

Description

Long story short

Critical bug, affecting aiohttp>2.0.3

Expected behaviour

Reading page/file content line by line with

async for Line in Response.content

Actual behaviour

Loop hangs until interpreter raises concurrent.futures._base.TimeoutError error

Steps to reproduce

import aiohttp
import asyncio

async def Init():

	Response = await aiohttp.request( "GET", "http://www.google.com/" )

	async for Line in Response.content:
		print( Line )

if __name__ == "__main__":

	Loop = asyncio.get_event_loop()
	Loop.run_until_complete( Init() )

Your environment

Tested on Windows 10 build 15063, Debian 8
Python 3.6
aiohttp>2.0.3

Traceback ( aiohttp 2.1.0 )

PS C:\Users\root\Desktop> pip install -q aiohttp==2.1.0
PS C:\Users\root\Desktop> .\test.py
Traceback (most recent call last):
  File "C:\Users\root\Desktop\test.py", line 16, in <module>
    Loop.run_until_complete( Init() )
  File "C:\Py36\lib\asyncio\base_events.py", line 466, in run_until_complete
    return future.result()
  File "C:\Users\root\Desktop\test.py", line 10, in Init
    async for Line in Response.content:
  File "C:\Py36\lib\site-packages\aiohttp\streams.py", line 36, in __anext__
    rv = yield from self.read_func()
  File "C:\Py36\lib\site-packages\aiohttp\streams.py", line 570, in readline
    return (yield from super().readline())
  File "C:\Py36\lib\site-packages\aiohttp\streams.py", line 268, in readline
    yield from self._wait('readline')
  File "C:\Py36\lib\site-packages\aiohttp\streams.py", line 235, in _wait
    yield from waiter
  File "C:\Py36\lib\site-packages\aiohttp\helpers.py", line 706, in __exit__
    raise asyncio.TimeoutError from None
concurrent.futures._base.TimeoutError

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions