[openstack-dev] [oslo] Logging exceptions and Python 3

Johannes Erdfelt johannes at erdfelt.com
Fri May 16 13:03:53 UTC 2014


On Fri, May 16, 2014, Igor Kalnitsky <ikalnitsky at mirantis.com> wrote:
> > According to http://legacy.python.org/dev/peps/pep-0352/ the message
> > attribute of BaseException is deprecated since Python 2.6 and was
> > dropped in Python 3.0.
> 
> Some projects have custom exception hierarchy, with strictly defined
> attributes (e.g. message, or something else). In a previous mail, I
> mean exactly that case, not the case with a built-in exceptions.

That's a fragile assumption to make.

unicode(exc) (or six.text_type(exc)) works for all exceptions, built-in
or custom. I don't see the reason why it's being avoided.

JE




More information about the OpenStack-dev mailing list