ros / xacro

Xacro is an XML macro language. With xacro, you can construct shorter and more readable XML files by using macros that expand to larger XML expressions.
http://www.ros.org/wiki/xacro
BSD 3-Clause "New" or "Revised" License
89 stars 99 forks source link

SyntaxWarning: invalid escape sequence '\$' #341

Closed bjsowa closed 8 months ago

bjsowa commented 8 months ago

Whenever I run xacro on ROS Rolling and Ubuntu Noble, I get this stderr output:

/opt/ros/rolling/lib/python3.12/site-packages/xacro/__init__.py:558: SyntaxWarning: invalid escape sequence '\$'
  default_value = '''\$\{.*?\}|\$\(.*?\)|(?:'.*?'|\".*?\"|[^\s'\"]+)+|'''
/opt/ros/rolling/lib/python3.12/site-packages/xacro/__init__.py:559: SyntaxWarning: invalid escape sequence '\s'
  re_macro_arg = re.compile(r'^\s*([^\s:=]+?)\s*:?=\s*(\^\|?)?(' + default_value + ')(?:\s+|$)(.*)')

If I build this package locally (version 2.0.10) I only get these warnings upon building.

I'm invoking xacro in command substitution in launch file like this:

<param name="robot_description" value="$(command 'xacro $(var model)')" />

The ros2 launch command complains about the stderr output and stops execution. This breaks the whole startup procedure of my robot.

I believe the fix to this was implemented in #336 but it was only commited to noetic-devel branch. Could you please backport the fix to ros2 branch and release a new version of the package to rosdistro?

rhaschke commented 8 months ago

Release done: https://github.com/ros/rosdistro/pull/40424