Andrew Svetlov added the comment: It's a known annoying issue. Honestly I don't know how to fix it properly. `transport.close()` is affected also because `protocol.connection_lost()` is called on next loop iteration only.
Adding a small `asyncio.sleep()` between finishing all worn and loop closing solves the problem for me but the solution is not obvious for newbies. ---------- nosy: +asvetlov _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue28212> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com