-
-
Notifications
You must be signed in to change notification settings - Fork 879
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
Remove temporary sanitized file when process is manually stopped in RStudio #2183
Comments
This is not relevant to knitr but rmarkdown and RStudio IDE. More likely to be an RStudio issue. In rmarkdown, the sanitized file is generated here: https://github.com/rstudio/rmarkdown/blob/f764a66d20768750ca6c2adac18f6830e665a9ca/R/render.R#L367 and cleaned up here (via It sounds like |
Thank you - that looks to be the case. I'll move this over to RStudio. Sorry for the noise. |
No worries. I tried to come up with a minimal reproducible example without rmarkdown, but didn't manage to create one. |
For the record, we have also run into a similar issue before in bookdown: rstudio/bookdown#986 (comment) |
This old thread has been automatically locked. If you think you have found something related to this, please open a new issue by following the issue guide (https://yihui.org/issue/), and link to this old issue if necessary. |
By filing an issue to this repo, I promise that
xfun::session_info('knitr')
. I have upgraded all my packages to their latest versions (e.g., R, RStudio, and R packages), and also tried the development version:remotes::install_github('yihui/knitr')
.I understand that my issue may be closed if I don't fulfill my promises.
If an input Rmd filename contains invalid characters (e.g. spaces;
this is my filename.Rmd
) then a temporary copy of the file with a sanitized filename is used when knitting (this-is-my-filename.Rmd
) which is removed on completion. If theknit
process is not completed (due to an error within a chunk) then this file is removed correctly (presumably via anon.exit()
).In RStudio, if the process is stopped via the Stop button then this hyphenated Rmd file is not deleted, and it blocks attempting to knit the file again, triggering the following (potentially confusing to the user, but entirely accurate) error
(possibly the issue causing #1110).
I don't fully appreciate how this RStudio button connects to the process of knitting, and this may actually be an RStudio bug (in which case I'm happy to re-file it over there), but perhaps there's another
on.exit()
to add here. I agree with the assessment in #1110 that this file shouldn't be overwritten, but if it was created as part of a failed knit, it should ideally be deleted.The 'proper' solution would be that users don't create filenames containing these characters. One could dream.
xfun::session_info('knitr')
R version 4.2.1 (2022-06-23)
Platform: aarch64-apple-darwin20 (64-bit)
Running under: macOS Monterey 12.6, RStudio 2022.2.3.492
Locale: en_AU.UTF-8 / en_AU.UTF-8 / en_AU.UTF-8 / C / en_AU.UTF-8 / en_AU.UTF-8
Package version:
evaluate_0.16 glue_1.6.2 graphics_4.2.1 grDevices_4.2.1 highr_0.9 knitr_1.40.2 magrittr_2.0.3 methods_4.2.1 stats_4.2.1 stringi_1.7.8
stringr_1.4.0 tools_4.2.1 utils_4.2.1 xfun_0.32 yaml_2.3.5
The text was updated successfully, but these errors were encountered: