[issue41478] Empty representation of AssertionError

Rémi Lapeyre report at bugs.python.org
Thu Aug 6 12:01:47 EDT 2020


Rémi Lapeyre <remi.lapeyre at henki.fr> added the comment:

> That's a solution, except you must know ahead of time this issue exists.

If we changed str(e) to make it the same as repr(e), there would be no way to get only the message. str(e) returns the message so if the message given was empty (or no message was given) you get an empty string. This cannot be changed without breaking a lot of code.

----------
versions: +Python 3.10, Python 3.9

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


More information about the Python-bugs-list mailing list