[issue45671] str(CancelledError()) is empty

2021-10-30 Thread lilydjwg
lilydjwg added the comment: OK, I see. -- resolution: -> not a bug stage: -> resolved status: open -> closed ___ Python tracker ___ _

[issue45671] str(CancelledError()) is empty

2021-10-30 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Then you would get >>> raise asyncio.CancelledError Traceback (most recent call last): File "", line 1, in asyncio.exceptions.CancelledError: CancelledError instead of >>> raise asyncio.CancelledError Traceback (most recent call last): File "", line 1

[issue45671] str(CancelledError()) is empty

2021-10-29 Thread lilydjwg
lilydjwg added the comment: Oh, I find that many exceptions return an empty string when created without any arguments, but most raised ones do have a descriptive error message. Yes, if it's going to change, we'd change all of them. But now I doubt if it's worth the effort... What if we chang

[issue45671] str(CancelledError()) is empty

2021-10-29 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Concur with Andrew. -- nosy: +serhiy.storchaka ___ Python tracker ___ ___ Python-bugs-list mail

[issue45671] str(CancelledError()) is empty

2021-10-29 Thread Andrew Svetlov
Andrew Svetlov added the comment: I don't think that we need to change something with the current behavior. It exists for years; very many Python exceptions return an empty string on `str(exc)` but return something useful on `repr(exc)`. If you arguing to change the behavior -- all such exce

[issue45671] str(CancelledError()) is empty

2021-10-29 Thread lilydjwg
New submission from lilydjwg : 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).