298b0328d2
An exception's message can be a translatable message. If it is, the message can contain unicode characters which will cause str to fail. In cases where the message is explicity needed, the use of str is replaced with the use of six.text_type. When an exception is used as a replacement string in a format string, the logger correctly handles it without the need for str, so it is removed. In addition to the case where a translatable message contains unicode, enabling lazy translation in the oslo.i18n library causes translatable messages to be replaced with an object that does not support str, this causes all calls to str on a translatable message to fail. Thus this patch is also needed to support blueprint: i18n-enablement. This patch includes a hacking check for use of str() on exceptions identified in except statements. Change-Id: Idb426d7f710ea69b835f70d0e883e93e9b9111d2 Partially-Implements: blueprint i18n-enablement |
||
---|---|---|
.. | ||
__init__.py | ||
checks.py |