r-lib / zip

Platform independent zip compression via miniz
https://r-lib.github.io/zip/
Other
83 stars 19 forks source link

Different behaviour in Windows before and after running `library(zip)` #116

Open context-dependent opened 2 months ago

context-dependent commented 2 months ago

Ran into this issue on Windows 11, attempting to unzip an archive with descendent files having names that include single quotes.

An example directory structure:

problematic-filenames.zip
   /l'esprit du corps.png

After installing, but prior to running library(zip),

zip::unzip("problematic-filenames.zip")

Panics and exits with error code 1, R_ZIP_EOPEN.

After running library(zip), identical calls produced the desired result in current and subsequent sessions, even after reinstalling the zip package.

I don't know how to reproduce the error, as I don't know how to undo the side-effect(s) of library(zip), but I do know that the default zip tool in windows 11 will panic when asked to zip folders with files whose paths contain single quotes.

The problem with this difference is that, when r-lib/zip is imported into another package as a dependency, users of the dependent package on Windows may experience unforeseen errors if they haven't called library(zip), which seems bad.