In python3, str is already represents unicode data. The current code called oslo.utils safe_encode irrespective of incoming message encoding and encoded it to 'utf-8', however that resolves to a byte string. Since the syslog module expects a message of type unicode[1]. We don't need to encode if python3 is being used, since the string representation is sequence of unicode codepoints by default. [1] https://hg.python.org/cpython/file/tip/Modules/syslogmodule.c#l162 Change-Id: Id40854d6b762b2d639afd7168ddb3a1e728d13d7
3.9 KiB
3.9 KiB