[New-bugs-announce] [issue45671] str(CancelledError()) is empty

lilydjwg report at bugs.python.org
Fri Oct 29 12:48:16 EDT 2021


New submission from lilydjwg <lilydjwg at gmail.com>:

When I try to print an asyncio.CancelledError object, I do not see it and I thought something went wrong.

CancelledError inherits from BaseException and all BaseException subclasses (e.g. SystemExit, KeyboardInterrupted) seem to return empty strings for str(e). While I never tried to print SystemExit or KeyboardInterrupted, I did try to print an CancelledError. It doesn't have a lot information but all other exceptions I tried to print return something so I expect CancelledError to be the same.

I know repr(e). I was just lazy and I expect Python to not be confusing even I'm lazy.

----------
components: asyncio
messages: 405318
nosy: asvetlov, lilydjwg, yselivanov
priority: normal
severity: normal
status: open
title: str(CancelledError()) is empty
type: enhancement
versions: Python 3.9

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45671>
_______________________________________


More information about the New-bugs-announce mailing list