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

Log module triggers unwanted exceptions #2096

Open
LuiggiTenorioK opened this issue Feb 3, 2025 · 0 comments · May be fixed by #2113
Open

Log module triggers unwanted exceptions #2096

LuiggiTenorioK opened this issue Feb 3, 2025 · 0 comments · May be fixed by #2113
Assignees
Labels
bug Something isn't working

Comments

@LuiggiTenorioK
Copy link
Member

While developing features in Autosubmit I realized that the log module enforces a format on the message string even if no parameters were sent. This could be problematic when displaying formattable-like strings that are not intended to be formatted, like in this situation:

Log.info("This is a set of fruits: {apple, orange, banana}")
# Raise KeyError: 'apple, orange, banana'

This will crash since it will try to "This is a set of fruits: {apple, orange, banana}".format(*args) without any args.

I think that the log functions should be robust enough to deal with this to not trigger unwanted exceptions. This is critical because, in many parts of the code, we don't have full control of what is logged.

@LuiggiTenorioK LuiggiTenorioK added the bug Something isn't working label Feb 3, 2025
@LuiggiTenorioK LuiggiTenorioK linked a pull request Feb 7, 2025 that will close this issue
@LuiggiTenorioK LuiggiTenorioK linked a pull request Feb 7, 2025 that will close this issue
@LuiggiTenorioK LuiggiTenorioK self-assigned this Feb 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant