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 JohannesEbke
Recipients JohannesEbke, MartinAltmayer, gvanrossum, tatellos, vstinner, yselivanov
Date 2016-06-20.11:27:18
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
Right, that's neater. Attached is a patch with your version and a test. I checked that it fails with the old version of cancel() and passes with the new one.

Concerning possible other bugs, I've had a look in the standard library, but could not find another instance where Future.cancel() is overwritten and has special handling. I also had a look at the try/except Exception blocks in lib/asyncio, but possible Cancellations are handled correctly there.

I believe the main source of bugs in this context will probably be other asyncio-based libraries. Either by inadvertently catching CancellationErrors in a try/except Exception block and treating them like other errors, or by not protecting resources with try/finally across yield points which might throw a CancellationError.

Not all libraries use cancel() internally, so the authors might not be aware that they have to write "cancellation-safe" code.
Date User Action Args
2016-06-20 11:27:20JohannesEbkesetrecipients: + JohannesEbke, gvanrossum, vstinner, MartinAltmayer, yselivanov, tatellos
2016-06-20 11:27:20JohannesEbkesetmessageid: <>
2016-06-20 11:27:20JohannesEbkelinkissue26923 messages
2016-06-20 11:27:19JohannesEbkecreate