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

.checkTypos: Avoid giving arbitrary strings to gettextf #6590

Merged
merged 5 commits into from
Oct 21, 2024

Conversation

aitap
Copy link
Contributor

@aitap aitap commented Oct 21, 2024

As reported in #6588, err$message is already translated at this point and may contain %. Avoid trying to printf-expand it once again.

Fixes: #6588

err$message is already translated at this point and may contain printf
specifiers. Avoid trying to expand it once again.
Copy link

codecov bot commented Oct 21, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 98.60%. Comparing base (717981d) to head (11c18bd).
Report is 1 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #6590   +/-   ##
=======================================
  Coverage   98.60%   98.60%           
=======================================
  Files          79       79           
  Lines       14516    14516           
=======================================
  Hits        14314    14314           
  Misses        202      202           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

R/data.table.R Outdated Show resolved Hide resolved
Copy link
Member

@MichaelChirico MichaelChirico left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great spot!

@MichaelChirico
Copy link
Member

Can you think of a way to regression-test this? I know the OP will be tough since it came from data.table not being attached, what if we have a table with a variable with % in the name?

@aitap
Copy link
Contributor Author

aitap commented Oct 21, 2024

Can you think of a way to regression-test this?

It can't be object 'foo' not found because there is a special case for this error. x[x %no such operator% "a"] seems to give the string with the percent signs to stopf too.

@MichaelChirico
Copy link
Member

Wow, TIL a %doesn't exist% b parses 🫨

@MichaelChirico MichaelChirico merged commit e5b845e into master Oct 21, 2024
7 of 8 checks passed
@MichaelChirico MichaelChirico deleted the fix-6588 branch October 21, 2024 21:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Error in sprintf(gettext(fmt, domain = domain, trim = trim), ...) too few arguments (when %like% not found)
3 participants