Comment 2 for bug 1419588

Revision history for this message
Kun Huang (academicgareth) wrote :

@Ian

Seeing the history, the logging module doesn't encode/decode strings very well. So we have to encode/decode before the log behavior. Putting this in common place could make codes clean.

But I found __init__ is not the good choice. __str__/__unicode__ is better in this case, because:

LOG(err) calls err.__str__ and would fail in some character. So the duty to pass correct encoded or decoded string is the duty of __str__/__unicode__.