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

gui(web_services): Fix not all arguments converted during string formatting #5136

Merged
merged 1 commit into from
Feb 18, 2025

Conversation

echoix
Copy link
Member

@echoix echoix commented Feb 18, 2025

Fixes a string causing problems after #4052, reported in #4052 (comment)

It was a simple typo, on my keyboard layout, $% are right next to each other.

@echoix echoix requested a review from petrasovaa February 18, 2025 02:47
@github-actions github-actions bot added GUI wxGUI related Python Related code is in Python labels Feb 18, 2025
@echoix
Copy link
Member Author

echoix commented Feb 18, 2025

I also verified, there are no other instances of "$s" that are the same kind of typo.
Even by enabling all ruff rules, and clearing the disabled rules of pylint, none of them would have caught that. Maybe because it is the result of calling a function, so it is difficult to be sure that the returned string would have placeholders.

If there were to have a pylint rule, it would be in a W130X or W13XX rule, like this one:
W1310: https://pylint.readthedocs.io/en/latest/user_guide/messages/warning/format-string-without-interpolation.html
W1301: https://pylint.readthedocs.io/en/latest/user_guide/messages/warning/unused-format-string-key.html

Removing the _() around the string makes pylint find the W1310, so it was the function call that hid it.

@petrasovaa petrasovaa merged commit 938b9ad into OSGeo:main Feb 18, 2025
26 checks passed
@github-actions github-actions bot added this to the 8.5.0 milestone Feb 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
GUI wxGUI related Python Related code is in Python
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants