Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RF7 regression: Arguments passed to BuildIn.run_keyword are expanded under specific conditions #5031

Open
robinmackaij opened this issue Jan 20, 2024 · 2 comments · May be fixed by #5042
Open

Comments

@robinmackaij
Copy link
Contributor

When using BuildIn.run_keyword the (positional) arguments that follow the target keyword name should be passed to the keyword "as is".

A change in RF7 changed this behavior in a specific situation; if there are (exactly) 2 positional arguments following the keyword name and the first of those arguments is iterable and the second a mapping, the arguments are no longer passed "as is" but they are expanded before being passed to the target keyword.

@pekkaklarck
Copy link
Member

This is due to #5000. The motivation of that enhancement was making it more convenient for listeners and model modifiers to set keyword arguments, and it didn't occur to me that it would also affect using BuiltIn.run_keyword programmatically. Or possibly it did occur, but I thought it's so unlikely that it would cause problems that we don't need to care.

Fixing this issue so that BuiltIn.run_keyword works like earlier, without special cases, when used programmatically is easy. The problem is that then libraries using it cannot benefit from the more convenient API provided by #5000. That's unfortunate, but I believe that behavior is safer. We also already have various issues related to making it easier for libraries to call other keywords. I hope we could enhance that situation in general in RF 7.1 or latest in RF 8.0.

@pekkaklarck
Copy link
Member

This problem can be reproduced also without a library by passing keyword name and arguments as a list variable to Run Keyword so that it needs to resolve also arguments:

${name and args} =    Evaluate    'Log Many', ['a', 'b', 'c'], {'d': 'e'}
Run Keyword    @{name and args}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants