Don't use keyword `error` in encode
This is not supported in Python 2.6. Just use positional arguments.
Merge pull request #6313 from phenomenes/msg-encoding-fix

Don't use keyword `error` in encode