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 ikelly
Recipients gvanrossum, ikelly, vstinner, yselivanov
Date 2016-01-27.18:45:49
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
The idea is that the wrapped iterator is something potentially blocking, like a database cursor that doesn't natively support asyncio. Usage would be something like this:

async def get_data():
    cursor.execute('select * from stuff')
    async for row in AsyncIteratorWrapper(cursor):

Investigating this further, I think the problem is actually in await, not run_in_executor:

>>> async def test():
...     fut = asyncio.Future()
...     fut.set_exception(StopIteration())
...     print(await fut)
>>> loop.run_until_complete(test())
Date User Action Args
2016-01-27 18:45:49ikellysetrecipients: + ikelly, gvanrossum, vstinner, yselivanov
2016-01-27 18:45:49ikellysetmessageid: <>
2016-01-27 18:45:49ikellylinkissue26221 messages
2016-01-27 18:45:49ikellycreate