Skip to content

Error in renv::init() when there are accents in the path #629

@DanChaltiel

Description

@DanChaltiel

I experience the exact same messages as #527.

However, I found out that in my case this was due to accents (mostly "é") in the path of my project.

I cannot give you a true reproducible example but I could reproduce this bug with this minimal procedure:

  • In some test directory (without an accent in the path), create 2 plain old projects using RStudio > File > New Project > New directory > New Project
    • name one without accent
    • name the other with accént
  • In both, activate renv using Tools > Project Options > Environments > Use renv with this project. This will run renv::activate() in the console without issue.
  • In both, run renv::init() with choice 2

I also tried with choice 1, it throws several errors of connection and a warning but finally outputs a sucess message.

Here is the full console log:

console log
renv::activate()
* Project 'F:/Nextcloud GR/Programmation/test renv/avéc accent' loaded. [renv 0.12.5]
> Sys.setenv(LANG = "en")
> 
> renv::init()
This project already has a private library. What would you like to do? 

1: Activate the project and use the existing library.
2: Re-initialize the project with a new library.
3: Abort project initialization.

Selection: 2
* Initializing project ...
Error in normalizePath(path, winslash = winslash, mustWork = mustWork) : 
  file name conversion problem -- name too long?
> renv::init()
This project already has a private library. What would you like to do? 

1: Activate the project and use the existing library.
2: Re-initialize the project with a new library.
3: Abort project initialization.

Selection: 1

Restarting R session...

Error in gzfile(file, "wb") : cannot open the connection
Error saving session (options): R code execution error
Error in file(file, "wb") : cannot open the connection
Error saving session (search_path): R code execution error
WARNING: Forcing suspend of process in spite of all session data not being fully saved.
# Bootstrapping renv 0.12.5 --------------------------------------------------
* Downloading renv 0.12.5 from CRAN ... OK
* Installing renv 0.12.5 ... Done!
* Successfully installed and loaded renv 0.12.5.
* Project 'F:/Nextcloud GR/Programmation/test renv/avéc accent' loaded. [renv 0.12.5]
> renv::init()
This project already has a private library. What would you like to do? 

1: Activate the project and use the existing library.
2: Re-initialize the project with a new library.
3: Abort project initialization.

Selection: 
Enter an item from the menu, or 0 to exit
Selection: 2
* Initializing project ...
* Discovering package dependencies ... Done!
* Copying packages into the cache ... Done!
The following package(s) will be updated in the lockfile:

# CRAN ===============================
- renv   [* -> 0.12.5]

* Lockfile written to 'F:/Nextcloud GR/Programmation/test renv/avéc accent/renv.lock'.

Restarting R session...

Error in gzfile(file, "wb") : impossible d'ouvrir la connexion
Error saving session (options): R code execution error
Error in file(file, "wb") : impossible d'ouvrir la connexion
Error saving session (search_path): R code execution error
WARNING: Forcing suspend of process in spite of all session data not being fully saved.
* Project 'F:/Nextcloud GR/Programmation/test renv/avéc accent' loaded. [renv 0.12.5]

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions