UnicodeEncodeError: ‘ascii‘ codec can‘t encode character u‘\u548c‘ in position 10804: ordinal not in

遇到'ascii' codec无法编码特定Unicode字符的问题,导致程序出错。解决方法是在相关文件顶部添加代码指定文件字符集为utf-8,例如在spawn_model文件中导入sys模块并重新设置默认编码为utf-8。
摘要由CSDN通过智能技术生成

[ INFO] [1618190102.105317159]: waitForService: Service [/gazebo/set_physics_properties] has not been advertised, waiting…
Traceback (most recent call last):
File “/home/gym-gazebo/gym_gazebo/envs/installation/catkin_ws/src/gazebo_ros_pkgs/gazebo_ros/scripts/spawn_model”, line 240, in
exit_code = sm.run()
File “/home//gym-gazebo/gym_gazebo/envs/installation/catkin_ws/src/gazebo_ros_pkgs/gazebo_ros/scripts/spawn_model”, line 150, in run
xml_parsed = xml.etree.ElementTree.fromstring(model_xml)
File “/usr/lib/python2.7/xml/etree/ElementTree.py”, line 1311, in XML
parser.feed(text)
File “/usr/lib/python2.7/xml/etree/ElementTree.py”, line 1657, in feed
self._parser.Parse(data, 0)
UnicodeEncodeError: ‘ascii’ codec can’t encode character u’\u548c’ in position 10804: ordinal not in range(128)
[ INFO] [1618190102.806404389]: waitForService: Service [/gazebo/set_physics_properties] is now available.
[ INFO] [1618

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值