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 asvetlov
Recipients Roland Netzsch, asvetlov, yselivanov
Date 2019-06-08.13:21:36
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1560000097.01.0.954638205945.issue37202@roundup.psfhosted.org>
In-reply-to
Content
This is the expected behavior.

asyncio.ensure_future() returns not a future but a task for your case.
Task cancellation requires at least one context switch to finish the task.

P.S.
I suggest replacing `asyncio.ensure_future()` with `asyncio.create_task()` to avoid confusion.
History
Date User Action Args
2019-06-08 13:21:37asvetlovsetrecipients: + asvetlov, yselivanov, Roland Netzsch
2019-06-08 13:21:37asvetlovsetmessageid: <1560000097.01.0.954638205945.issue37202@roundup.psfhosted.org>
2019-06-08 13:21:37asvetlovlinkissue37202 messages
2019-06-08 13:21:36asvetlovcreate