-
Notifications
You must be signed in to change notification settings - Fork 27
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
read_char() chokes on input with an invalid encoding #152
Comments
@jimhester Can you please point me to the R code that runs on the cloud check container? If that uses rcmdcheck as well then maybe this is a processx bug. Some more discussion: #151 |
It does not use rcmdcheck in the cloud code. The code is in a private repo, I can send you a link in slack. |
OK, in that case it is hard to say how the output is corrupted. Maybe it is a base R bug, maybe it is something else. We can change rcmdcheck to to give a warning if the input is not in the native encoding, instead of erroring. revdepcheck should still convert the cloud check output to the native encoding from UTF-8 (which we can assume for the the cloud check output, right?). If it is not doing that already. This would make cloud checks work on Windows for example. Or rcmdcheck could automatically try UTF-8 if the native encoding fails. So in the end this can be worked around in rcmdcheck, I'll transfer this issue back there. :( |
Yeah I think we can assume the tests were run in UTF-8. |
- Always convert output to UTF-8. - Use the <xx> notation for bytes that are invalid in the native encoding. Closes #152.
I came across this by running
revdepcheck::cloud_report()
on shiny and it seems @hadley was seeing the same thing in r-lib/revdepcheck#288 and attempted to fix in #133, but that was never merged. In my case, I was seeing:It turns out the error was coming from this call to
rcmdcheck:::get_test_fail()
which in turns callsrcmdcheck:::read_char()
I can reproduce the error locally by trying to read in
{ipc}
'stestthat.Rout.fail
file the same way asrcmdcheck:::read_char()
:With
useBytes = TRUE
, I can successfully read the file, but another downstream failure happens inrcmdcheck:::get_test_fail()
's call tonchar()
(I'm guessing this is why @hadley said #133 (comment))However, if I change the encoding to UTF-8, then it works:
The text was updated successfully, but these errors were encountered: