-
Notifications
You must be signed in to change notification settings - Fork 551
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
Python 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 |
PYTHONASYNCIODEBUG
in 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:
The text was updated successfully, but these errors were encountered: