diff --git a/R/data.table.R b/R/data.table.R index d0b940ae1..1c2c07a3f 100644 --- a/R/data.table.R +++ b/R/data.table.R @@ -123,7 +123,8 @@ replace_dot_alias = function(e) { stopf("Object '%s' not found amongst %s", used, brackify(ref)) } } else { - stopf(err$message) + # Don't use stopf() directly, since err$message might have '%', #6588 + stopf("%s", err$message, domain=NA) } } diff --git a/inst/tests/tests.Rraw b/inst/tests/tests.Rraw index c530b2fd1..2e90de1ba 100644 --- a/inst/tests/tests.Rraw +++ b/inst/tests/tests.Rraw @@ -20591,3 +20591,6 @@ setDT(d2) test(2295.1, !is.data.table(d1)) test(2295.2, rownames(d1), 'b') test(2295.3, is.data.table(d2)) + +# #6588: .checkTypos used to give arbitrary strings to stopf as the first argument +test(2296, d2[x %no such operator% 1], error = '%no such operator%')