fix(substitution_args.py): _resolve_args() not finding commands#380
fix(substitution_args.py): _resolve_args() not finding commands#380
Conversation
rhaschke
left a comment
There was a problem hiding this comment.
I cannot reproduce your issue. We do have a succeeding unit test for this:
Lines 570 to 573 in 1f24172
Could you please clarify under which circumstances you get the error?
Your solution introduces another dependency, which I would like to avoid.
|
I personally encountered it here. The reason, though, may not be related to my code but rather to the fact that I am using Nix/NixOS with nix-ros-overlay. Perhaps something changed between Python versions? Also, |
|
I've just run xacro tests under nix-ros-overlay and all of them seem to pass: I checked that |
|
@Amronos: could you create a minimal example, please. |
|
I wasn't able to create a minimal example, but I did find the below log upon appending <class 'xacro.substitution_args.SubstitutionException'>: Unknown substitution command [find\n variobot_control]. Valid commands are ['find', 'env', 'optenv', 'dirname', 'arg'] Unknown substitution command [find\n variobot_control]. Valid commands are ['find', 'env', 'optenv', 'dirname', 'arg']Looks like a Should I make this change or should Sorry for needlessly pinging you @wentasah! |
|
I prefer to have the |
xacro/substitution_args.py
Outdated
| @@ -333,10 +334,10 @@ def _resolve_args(arg_str, context, commands): | |||
| resolved = arg_str | |||
| for a in _collect_args(arg_str): | |||
| splits = [s for s in a.split(' ') if s] | |||
There was a problem hiding this comment.
Could you please check wheather splitting on any whitespace already resolves the problem too:
| splits = [s for s in a.split(' ') if s] | |
| splits = [s for s in a.split() if s] |
|
Thanks for reporting and iterating on this. |
The below wasn't working for me; replacing the custom split logic in
_resolve_args()withshlexseems to do the trick.Error log: