Closed schloerke closed 1 year ago
@hidjis and I found that RcppTOML::parseToml
is behaving as if it's reading in a CRLF delimited file when the file is a LF file after a plumber router has been ran. If R is restarted, everything works as expected until the plumber router is $run()
.
There is no cpp code inside plumber.
Thank you for the help! -Barret
Hm. I am not really sure what you expect me to do here.
Could this be a Windows thing? I can re-read the TOML after I Ctrl-C out of plumber:
R> RcppTOML::parseToml("tmp.toml")
List of 1
$ database:List of 2
..$ host: chr "0.0.0.0"
..$ user: chr "toto"
R>
R> plumber::plumb("example.R")$run()
Starting server to listen on port 8971
Running the swagger UI at http://127.0.0.1:8971/__swagger__/
^C
R> RcppTOML::parseToml("tmp.toml")
List of 1
$ database:List of 2
..$ host: chr "0.0.0.0"
..$ user: chr "toto"
R>
I believe it's a windows only problem. Could not reproduce on mac. Could reproduce on windows VM.
What I find odd is that the file is not being touched, but parseToml is interpreting the file with CRLF after plumber is closed in windows when the file does not contain CRLF line endings.
Agreed on both counts, and am as puzzled. I don't think the TOML parser does anything funky -- it just slurps a file. There should really be no side effects. Weird.
Closing as stale.
Moving issue trestletech/plumber#293 over to rcpptoml
From original post:
With a restarted console, I can parse the following TOML file (tmp.toml) with no errors:
# tmp.toml
Then, I can start plumber with the following simple example:
# example.R
But, if I stop the API, and try to parse again the toml file, I get the following error:
Any idea, why it's causing an error after calling plumber ? It looks like
plumber
is loadingRcppTOML
and changing its behavior.This is my sessionInfo at the beginning:
And at the end.
files.zip