Don't use keyword `error` in encode

This is not supported in Python 2.6. Just use positional arguments.