开发者社区> 问答> 正文

'ascii' codec can't encode ch:报错

Python "RemoteError: Remote error: UnicodeEncodeError 'ascii' codec can't encode ch:报错

{
  "traceback": "  File \"/opt/stackstorm/st2/lib/python2.7/site-packages/st2actions/container/base.py\", line 99, in _do_run\n    LOG.debug('Performing run for runner: %s' % (runner.runner_id), extra=extra)\n  File \"/opt/stackstorm/st2/lib/python2.7/site-packages/retrying.py\", line 49, in wrapped_f\n    def wrapped_f(*args, **kw):\n  File \"/opt/stackstorm/st2/lib/python2.7/site-packages/retrying.py\", line 206, in call\n    if not self.should_reject(attempt):\n  File \"/opt/stackstorm/st2/lib/python2.7/site-packages/retrying.py\", line 247, in get\n    else:\n  File \"/opt/stackstorm/st2/lib/python2.7/site-packages/retrying.py\", line 200, in call\n    try:\n  File \"/opt/stackstorm/runners/mistral_v2/mistral_v2.py\", line 219, in run\n    result = self.start(action_parameters=action_parameters)\n  File \"/opt/stackstorm/runners/mistral_v2/mistral_v2.py\", line 256, in start\n    **options)\n  File \"/opt/stackstorm/st2/lib/python2.7/site-packages/mistralclient/api/v2/executions.py\", line 56, in create\n    return self._create('/executions', data)\n  File \"/opt/stackstorm/st2/lib/python2.7/site-packages/mistralclient/api/base.py\", line 95, in _create\n    self._raise_api_exception(resp)\n  File \"/opt/stackstorm/st2/lib/python2.7/site-packages/mistralclient/api/base.py\", line 143, in _raise_api_exception\n    error_message=error_data)\n",
  
  
  "error": "RemoteError: Remote error: UnicodeEncodeError 'ascii' codec can't encode character u'\\xae' in position 169: ordinal not in range(128)\n[u'Traceback (most recent call last):\\n', u'  File \"/opt/stackstorm/mistral/lib/python2.7/site-packages/oslo_messaging/rpc/server.py\", line 155, in _process_incoming\\n    failure = None\\n', u'  File \"/opt/stackstorm/mistral/lib/python2.7/site-packages/oslo_messaging/rpc/dispatcher.py\", line 222, in dispatch\\n    if hasattr(endpoint, method):\\n', u'  File \"/opt/stackstorm/mistral/lib/python2.7/site-packages/oslo_messaging/rpc/dispatcher.py\", line 192, in _do_dispatch\\n    new_args[argname] = self.serializer.deserialize_entity(ctxt, arg)\\n', u'  File \"/opt/stackstorm/mistral/lib/python2.7/site-packages/mistral/engine/engine_server.py\", line 98, in start_workflow\\n    (rpc_ctx, workflow_identifier, utils.cut(workflow_input),\\n', u'  File \"/opt/stackstorm/mistral/lib/python2.7/site-packages/mistral/utils/__init__.py\", line 284, in cut\\n    return cut_dict(data, length=length)\\n', u'  File \"/opt/stackstorm/mistral/lib/python2.7/site-packages/mistral/utils/__init__.py\", line 198, in cut_dict\\n    v = str(value)\\n', u\"UnicodeEncodeError: 'ascii' codec can't encode character u'\\\\xae' in position 169: ordinal not in range(128)\\n\"]."
}

展开
收起
kun坤 2020-06-14 10:44:09 441 0
1 条回答
写回答
取消 提交回答
  • # encoding=utf8
    import  sys
    reload(sys)
    sys.setdefaultencoding("utf8")

    尝试了以上的方式,仍然无效。

    2020-06-14 10:44:14
    赞同 展开评论 打赏
问答排行榜
最热
最新

相关电子书

更多
阿里云 ClickHouse 企业版技术白皮书 立即下载
ClickHouse在手淘流量分析应用实践Jason Xu 立即下载
云数据库clickhouse最佳实践 立即下载