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 chris.jerdonek
Recipients asvetlov, bjs, chris.jerdonek, pagliaricci.m, yselivanov
Date 2021-10-07.06:46:58
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
> But, once the asyncio.Task is cancelled, is impossible to retrieve that original asyncio.CancelledError(msg) exception with the message, because it seems that *a new* asyncio.CancelledError() [without the message] is raised when asyncio.Task.result() or asyncio.Task.exception() methods are called.

You say it's "impossible", but isn't the message accessible via the exception chain (and visible in the traceback)? One benefit of not duplicating the message on the internal call to cancel() is that it makes it easier to pinpoint which CancelledError object is associated with the user's call to cancel(), and which is associated with the call done by asyncio internals, which is a different cancellation. Another benefit is that it prevents info from being duplicated in the traceback.
Date User Action Args
2021-10-07 06:46:58chris.jerdoneksetrecipients: + chris.jerdonek, asvetlov, yselivanov, bjs, pagliaricci.m
2021-10-07 06:46:58chris.jerdoneksetmessageid: <>
2021-10-07 06:46:58chris.jerdoneklinkissue45390 messages
2021-10-07 06:46:58chris.jerdonekcreate