R 4.2.0: RStudio specific error with devtools::check() in accented path directory

Original GitHub issue: usethis cannot find path with accents. · Issue #1630 · r-lib/usethis · GitHub


In R 4.2.0, the following works in a path containing an accent:

usethis::create_package("D:/é/mypkg")
usethis::use_package_doc()
devtools::document(roclets = c('rd', 'collate', 'namespace'))

devtools::check() also works in the console, but NOT when using the Ctr+Shift+E shortcut, or using RStudio's Check button:

getwd()
"D:/é/mypkg"

devtools::check()
[...]
checking R files for syntax errors ... ERROR
  Error in file 'R/mypkg-package.R':
    cannot open the connection
  Warning in file 'R/mypkg-package.R':
    cannot open file 'D:/C)/mypkg.Rcheck/00_pkg_src/mypkg/R/mypkg-package.R': No such file or directory

checking examples ... ERROR
  Running massageExamples to create 'mypkg-Ex.R' failed
  Error in find.package(package, lib.loc) : 
    there is no package called 'mypkg'
  Calls: <Anonymous> -> Rd_db -> find.package
  Execution halted
   NONE

Seems like the accent "é" is being replaced with letter "C" in the path. I've tried restarting Rstudio and my computer, to no avail. Recommendation on GitHub issue was to come here. Can anyone replicate?

1 Like

I can replicate on R4.2.0, RStudio 2022.02.2 + 485 "Prairie Trillium" Release (8acbd38b, 2022-04-19) , Windows 11.

I don't know if it's an {fs} bug though, as fs::path_wd() does return the correct path (i.e. with accent).

1 Like

Thanks for reporting this! I will take a look and report back if we need to file an issue in RStudio -- this has been a known issue in R 4.2.x on Windows that we've already released some fixes for, but this may still be outstanding.

1 Like

This topic was automatically closed after 45 days. New replies are no longer allowed.


If you have a query related to it or one of the replies, start a new topic and refer back with a link.