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 pagliaricci.m
Recipients asvetlov, bjs, chris.jerdonek, graingert, pagliaricci.m, yselivanov
Date 2021-10-09.13:00:14
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <CAHWeiQXw1LCv5A6qpUM=XVGHqG_PanpBSKG7egB-SSHzmRXG=A@mail.gmail.com>
In-reply-to <1633783860.72.0.303940725357.issue45390@roundup.psfhosted.org>
Content
Chris,
I'm attaching to this e-mail the code I'm referring to.
As you can see, in line 10, I re-raise the asyncio.CancelledError exception
with a message "TEST".
That message is lost, due to the reasons we've talked about.

My point is that, if we substitute that line 10, with the commented line
11, and we comment the line 10, so we raise a ValueError("TEST") exception,
as you can see, the message "TEST" is NOT LOST.
I just find this counter-intuitive, and error-prone.

AT LEAST should be very well specified in the docs.

Regards,
M.

On Sat, Oct 9, 2021 at 2:51 PM Chris Jerdonek <report@bugs.python.org>
wrote:

>
> Chris Jerdonek <chris.jerdonek@gmail.com> added the comment:
>
> > 2) Now: if I re-raise the asyncio.CancelledError as-is, I lose the
> message,
> if I call the `asyncio.Task.exception()` function.
>
> Re-raise asyncio.CancelledError where? (And what do you mean by
> "re-raise"?) Call asyncio.Task.exception() where? This isn't part of your
> example, so it's not clear what you mean exactly.
>
> ----------
>
> _______________________________________
> Python tracker <report@bugs.python.org>
> <https://bugs.python.org/issue45390>
> _______________________________________
>
Files
File name Uploaded
task_bug.py pagliaricci.m, 2021-10-09.13:00:14
History
Date User Action Args
2021-10-09 13:00:14pagliaricci.msetrecipients: + pagliaricci.m, asvetlov, chris.jerdonek, yselivanov, graingert, bjs
2021-10-09 13:00:14pagliaricci.mlinkissue45390 messages
2021-10-09 13:00:14pagliaricci.mcreate