AssertionError asyncio.streams in _drain_helper

Hmm, I’d recommend opening an issue on bugs.python.org. Since it’s not reproducible and only happens occasionally, it could potentially be a subtle race condition. Be sure to add “yselivanov” and “asvetlov” (maintainers of asyncio) to the nosy list. In the meantime, I’ll look into further into it and see if I can find any potential cause for the issue. Thanks for bringing it to our attention.

Additional information, such as how the StreamWriter object is being instantiated, the surrounding context in your protocol_send(), and platform used may be helpful.

Edit: Also, be sure to mention the specific Python version used.