At least on MS Windows and macOS, withTimeout() fail if the call that times out temporarily sets another language, e.g.
R.utils::withTimeout({
Sys.setenv(LANGUAGE='fr')
on.exit(Sys.unsetenv("LANGUAGE"))
repeat Sys.sleep(0.1)
}, timeout = 0.5, onTimeout = 'silent')
#> Error in Sys.sleep(0.1) : la limite de temps est atteinte
I'm not sure if this can be fixed. I doubt withTimeout() can identify the language that was set temporarily, which means we cannot parse the captured error message and identify it as a timeout error message.
[x] Document this limitation
[ ] Create a feature request for base R to signal a timeoutError object instead of just an error.
Related
This was related to Issue #133, but most likely not the same problem.
Issue
At least on MS Windows and macOS,
withTimeout()
fail if the call that times out temporarily sets another language, e.g.I've added a package test for this (commit https://github.com/HenrikBengtsson/R.utils/commit/c4fd62ecac3c233d7d92e57ee813b0e11aa3f1dd) and it turns out that this happens on MS Windows and macOS, but not Linux, cf. https://github.com/HenrikBengtsson/R.utils/actions/runs/3308331545.
Action
I'm not sure if this can be fixed. I doubt
withTimeout()
can identify the language that was set temporarily, which means we cannot parse the captured error message and identify it as a timeout error message.timeoutError
object instead of just anerror
.Related
This was related to Issue #133, but most likely not the same problem.