This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author yselivanov
Recipients gvanrossum, r.david.murray, vstinner, yselivanov
Date 2014-10-06.23:23:13
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
I think that the main problem is that '_stop_server' is called from a main thread (by unittest machinery via addCleanup), whereas the loop is in the other thread. asyncio code is not thread-safe in general.

If I change your code slightly to avoid using addCleanup, then everything works:

FWIW I couldn't reproduce the "NoneType object is not iterable" error. On my machine with python3.4.1 it crashes with another error "AssertionError: server did not stop" on line 35.
Date User Action Args
2014-10-06 23:23:13yselivanovsetrecipients: + yselivanov, gvanrossum, vstinner, r.david.murray
2014-10-06 23:23:13yselivanovsetmessageid: <>
2014-10-06 23:23:13yselivanovlinkissue22572 messages
2014-10-06 23:23:13yselivanovcreate