Comment 2 for bug 1274245

Revision history for this message
Jay Bryant (jsbryant) wrote : Re: should remove the use of str() in Cinder

Ok, so I think I better understand the situation here:

1) They had issues with doing translation in havana because they were getting a mixture of basestrings from str() and unicode strings. If you attempt to use str() on a unicode string and there is something that doesn't translate to ASCII this causes an exception and the message/string in question just disappears. This issue was what caused the lazy translation to be removed at the last minute from havana.

2) There is a workaround in gettextutils that 'should' catch these issues, but if you are doing an str() on unicode further up the stack you could still encounter the same issue.

3) Why the move to six.text_type? Because in py2 you have unicode but in py3 they are changing unicode to string. So, it is best right now to just switch to using six.text_type to avoid the logging issue and so that there are no issues when moving to py3 with the change from unicode to string.