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 <1412637793.32.0.146825727905.issue22572@psf.upfronthosting.co.za>
In-reply-to
Content
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: https://gist.github.com/1st1/8dd0a2d4aa1ffd895c52

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.
History
Date User Action Args
2014-10-06 23:23:13yselivanovsetrecipients: + yselivanov, gvanrossum, vstinner, r.david.murray
2014-10-06 23:23:13yselivanovsetmessageid: <1412637793.32.0.146825727905.issue22572@psf.upfronthosting.co.za>
2014-10-06 23:23:13yselivanovlinkissue22572 messages
2014-10-06 23:23:13yselivanovcreate