UnicodeEncodeError:“ascii”编解码器无法对131位的字符u“\xa7”进行编码:序号不在范围内(128)

2024-09-30 20:19:50 发布

您现在位置:Python中文网/ 问答频道 /正文

我在Python2.7中使用ROS-Melodic,当我尝试启动一个文件时,出现如下错误:

如何解决这个问题?这以前从未发生过

roslaunch my_robot_description myrobot.launch
    ... logging to /home/murtaza/.ros/log/7d1ccb5c-a35a-11e9-b27a-000c298dc171/roslaunch-ubuntu-48848.log
    Checking log directory for disk usage. This may take awhile.
    Press Ctrl-C to interrupt
    Done checking log file disk usage. Usage is <1GB.

    Traceback (most recent call last):
      File "/opt/ros/melodic/bin/roslaunch", line 35, in <module>
        roslaunch.main()
      File "/opt/ros/melodic/lib/python2.7/dist-packages/roslaunch/__init__.py", line 326, in main
        handle_exception(roslaunch_core, logger, "RLException: ", e)
      File "/opt/ros/melodic/lib/python2.7/dist-packages/roslaunch/__init__.py", line 225, in handle_exception
        roslaunch_core.printerrlog(msg + str(e))
    UnicodeEncodeError: 'ascii' codec can't encode character u'\xa7' in position 131: ordinal not in range(128)

Tags: toinlogmainlibpackagesdistline