Ask Your Question
1

catkin build -- UnicodeEncodeError: 'ascii' codec can't encode character u'\xa7' in position 5: ordinal not in range(128)

asked 2020-05-07 09:44:26 -0500

magnus gravatar image

Worked on Gazebo plugins when suddenly I could no longer build my catkin workspace. I would appreciate any advice and help you can give to help me with this. The error is:

UnicodeEncodeError: 'ascii' codec can't encode character u'\xa7' in position 5: ordinal not in range(128)

The full error output below:

magnus@magnus-vm:~/catkin_ws$ catkin build                                                        
--------------------------------------------------------------------------
Profile:                     default                                                                     
Extending:             [env] /opt/ros/melodic:/home/magnus/catkin_ws/devel
Workspace:                   /home/magnus/catkin_ws
--------------------------------------------------------------------------
Build Space:        [exists] /home/magnus/catkin_ws/build
Devel Space:        [exists] /home/magnus/catkin_ws/devel
Install Space:      [unused] /home/magnus/catkin_ws/install
Log Space:         [missing] /home/magnus/catkin_ws/logs
Source Space:       [exists] /home/magnus/catkin_ws/src
DESTDIR:            [unused] None
--------------------------------------------------------------------------
Devel Space Layout:          linked
Install Space Layout:        None
--------------------------------------------------------------------------
Additional CMake Args:       None
Additional Make Args:        None
Additional catkin Make Args: None
Internal Make Job Server:    True
Cache Job Environments:      False
--------------------------------------------------------------------------
Whitelisted Packages:        None
Blacklisted Packages:        None
--------------------------------------------------------------------------
Workspace configuration appears valid.
--------------------------------------------------------------------------

Traceback (most recent call last):
  File "/usr/bin/catkin", line 11, in <module>
    load_entry_point('catkin-tools==0.4.5', 'console_scripts', 'catkin')()
  File "/usr/lib/python2.7/dist-packages/catkin_tools/commands/catkin.py", line 272, in main
    catkin_main(sysargs)
  File "/usr/lib/python2.7/dist-packages/catkin_tools/commands/catkin.py", line 267, in catkin_main
    sys.exit(args.main(args) or 0)
  File "/usr/lib/python2.7/dist-packages/catkin_tools/verbs/catkin_build/cli.py", line 422, in main
    summarize_build=opts.summarize  # Can be True, False, or None
  File "/usr/lib/python2.7/dist-packages/catkin_tools/verbs/catkin_build/build.py", line 283, in build_isolated_workspace
    workspace_packages = find_packages(context.source_space_abs, exclude_subspaces=True, warnings=[])
  File "/usr/lib/python2.7/dist-packages/catkin_pkg/packages.py", line 87, in find_packages
    packages = find_packages_allowing_duplicates(basepath, exclude_paths=exclude_paths, exclude_subspaces=exclude_subspaces, warnings=warnings)
  File "/usr/lib/python2.7/dist-packages/catkin_pkg/packages.py", line 148, in find_packages_allowing_duplicates
    xml, filename=filename, warnings=warnings)
  File "/usr/lib/python2.7/dist-packages/catkin_pkg/package.py", line 710, in parse_package_string
    export.attributes[str(key)] = str(value)
UnicodeEncodeError: 'ascii' codec can't encode character u'\xa7' in position 5: ordinal not in range(128)

If I can provide any further detail, let me know! Thank you in advance!

edit retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted
1

answered 2020-05-08 03:00:15 -0500

gvdhoorn gravatar image

It's likely you have a unicode character in the package manifest which trips things up.

0xA7 is a SECTION SIGN (or: §) according to charbase.com/00a7-unicode-section-sign.

You'll have to check your package.xml to see where that character is and remove it.

edit flag offensive delete link more

Comments

Thank you, that solved my issue. I found the § character and removed it

magnus gravatar image magnus  ( 2020-05-08 03:21:31 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2020-05-07 09:44:26 -0500

Seen: 31 times

Last updated: May 08