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 njs
Recipients asvetlov, njs, vstinner, yselivanov
Date 2018-01-24.02:11:13
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1516759873.88.0.467229070634.issue32636@psf.upfronthosting.co.za>
In-reply-to
Content
Ah-hah, I get what's going on.

@asyncio.coroutine has always been buggy: when debug mode is turned on, then it fails to set CO_ITERABLE_COROUTINE.

However, when debug mode is turned on, then traditionally native coroutines got wrapped into CoroWrapper objects. We've always been lazy and reused the same CoroWrapper type for both native coroutines and old-style @asyncio.coroutine coroutines, so CoroWrapper has both coroutine and generator attributes.

This means that until my patch, in debug mode, native coroutines were *getting turned back into generators*. So this hid the bug in @asyncio.coroutine, because it doesn't matter if you can't call native coroutines if you've just turned them into generators.

The fix is trivial, we just need to always use @types.coroutine in @asyncio.coroutine, I'll put up a PR momentarily.
History
Date User Action Args
2018-01-24 02:11:13njssetrecipients: + njs, vstinner, asvetlov, yselivanov
2018-01-24 02:11:13njssetmessageid: <1516759873.88.0.467229070634.issue32636@psf.upfronthosting.co.za>
2018-01-24 02:11:13njslinkissue32636 messages
2018-01-24 02:11:13njscreate