Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upPython 3.7 "TCP echo server using streams" sample code does not work with uvloop. #221
Comments
|
Thank you for reporting. This is basically a duplicate of #211. |
|
This was fixed by PR #224 |
|
I don't believe PR #224 fixes this issue. This issue is caused because the stock asyncio.base_events.Server in Python 3.7 was made into an asynchronous context manager. The entry method is simple:
while the exit method closes the server:
The TCP echo server uses this manager in an The uvloop replacement, uvloop.loop.Server, does not implement the methods for an asynchronous context manager in the master branch or in commit #8fac545a9351935eefc0c8d281bebd0dd2917d66 to address PR #224. |
The Server class was missing __aenter__ and __aexit__ magic methods to
allow usage of the form:
async with server:
await server.serve_forever()
The Server class was missing __aenter__ and __aexit__ magic methods to
allow usage of the form:
async with server:
await server.serve_forever()
The Server class was missing __aenter__ and __aexit__ magic methods to
allow usage of the form:
async with server:
await server.serve_forever()
|
The error persists. Won't the fix be merged? Edit: more info:
|
|
The fix landed for v0.13.0, you can for instance give the release candidate a go: https://github.com/MagicStack/uvloop/releases/tag/v0.13.0rc1 |
PYTHONASYNCIODEBUGin env?: not testedRunning the following code (source: https://docs.python.org/3/library/asyncio-stream.html#tcp-echo-server-using-streams) with uvloop:
Produces the following error message: