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 methane
Recipients abacabadabacaba, methane, yselivanov
Date 2017-04-12.08:46:31
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1491986792.0.0.939317017155.issue30048@psf.upfronthosting.co.za>
In-reply-to
Content
This behavior is documented as:

https://docs.python.org/3.6/library/asyncio-task.html#asyncio.Task.cancel

> Unlike Future.cancel(), this does not guarantee that the task will be cancelled: the exception might be caught and acted upon, delaying cancellation of the task or preventing cancellation completely. The task may also return a value or raise a different exception.
>
> Immediately after this method is called, cancelled() will not return True (unless the task was already cancelled). A task will be marked as cancelled when the wrapped coroutine terminates with a CancelledError exception (even if cancel() was not called).

I agree that this behavior is somewhat surprising.
But I don't know how can I fix the behavior.
History
Date User Action Args
2017-04-12 08:46:32methanesetrecipients: + methane, abacabadabacaba, yselivanov
2017-04-12 08:46:32methanesetmessageid: <1491986792.0.0.939317017155.issue30048@psf.upfronthosting.co.za>
2017-04-12 08:46:31methanelinkissue30048 messages
2017-04-12 08:46:31methanecreate