Reputation: 65
I'm trying to make aiohttp work, tho the simplest code possible is not working. The issue is only present on a specific development server, which is compiled from source.
The following code produces the following output:
from aiohttp import web
async def hello(request):
return web.Response(text="Hello, world")
app = web.Application()
app.add_routes([web.get('/', hello)])
web.run_app(app)
And I get an empty reply from the server (wget produces the same output)
# ./curl-amd64 http://localhost:8080/ -v
* Trying 127.0.0.1:8080...
* Connected to localhost (127.0.0.1) port 8080 (#0)
> GET / HTTP/1.1
> Host: localhost:8080
> User-Agent: curl/7.75.0
> Accept: */*
>
* Recv failure: Connection reset by peer
* Closing connection 0
curl: (56) Recv failure: Connection reset by peer
Im running python 3.8.1 on a custom built linux kernel 5.3.18. Pip is available on the local system. When I run pip install aiohttp, all dependencies are met response is received.
# pip install aiohttp
Requirement already satisfied: aiohttp in /usr/lib/python3.8/site-packages (3.5.4)
Requirement already satisfied: attrs>=17.3.0 in /usr/lib/python3.8/site-packages (from aiohttp) (19.3.0)
Requirement already satisfied: chardet<4.0,>=2.0 in /usr/lib/python3.8/site-packages (from aiohttp) (3.0.4)
Requirement already satisfied: multidict<5.0,>=4.0 in /usr/lib/python3.8/site-packages (from aiohttp) (4.5.2)
Requirement already satisfied: async_timeout<4.0,>=3.0 in /usr/lib/python3.8/site-packages (from aiohttp) (3.0.1)
Requirement already satisfied: yarl<2.0,>=1.0 in /usr/lib/python3.8/site-packages (from aiohttp) (1.3.0)
Requirement already satisfied: idna>=2.0 in /usr/lib/python3.8/site-packages (from yarl<2.0,>=1.0->aiohttp) (2.8)
#
This issue is only present on this specific system. When I copy the code to a different machine (e.g. mac) the server is responding fine.
Is there anything, that might be missing from the system (system library, shared module etc.) which might be causing this issue?
Upvotes: 2
Views: 882
Reputation: 65
Upgrading the package to the latest version helped.
aiohttp==3.7.4.post0
Upvotes: 2