Skip to content

Conversation

@axelpale
Copy link
Contributor

@axelpale axelpale commented Oct 12, 2017

Because yauzl is able to read from buffers and file descriptors, it is not clear what source means in extract-zip. I fell into that trap and tried to feed it a Buffer, just to receive this not-so-obvious error:

{ Error: Path must be a string without null bytes
at nullCheck (fs.js:117:14)
at Object.fs.open (fs.js:543:8)
at Object.open (/Users/xeli/Build/tresdb/node_modules/yauzl/index.js:28:6)
at openZip (/Users/xeli/Build/tresdb/node_modules/extract-zip/index.js:30:11)
at /Users/xeli/Build/tresdb/node_modules/extract-zip/index.js:23:7
at LOOP (fs.js:1611:14)
at _combinedTickCallback (internal/process/next_tick.js:67:7)
at process._tickCallback (internal/process/next_tick.js:98:9) code: 'ENOENT' }

Therefore, here I propose that readme.md is improved so that source is changed to sourcePath and target to targetPath to protect others from this trap.

Because yauzl is able to read from buffers and file descriptors, it is not clear what `source` means. I fell into that trap and tried to feed it a Buffer, just to receive this not-so-obvious error:

    { Error: Path must be a string without null bytes
    at nullCheck (fs.js:117:14)
    at Object.fs.open (fs.js:543:8)
    at Object.open (/Users/xeli/Build/tresdb/node_modules/yauzl/index.js:28:6)
    at openZip (/Users/xeli/Build/tresdb/node_modules/extract-zip/index.js:30:11)
    at /Users/xeli/Build/tresdb/node_modules/extract-zip/index.js:23:7
    at LOOP (fs.js:1611:14)
    at _combinedTickCallback (internal/process/next_tick.js:67:7)
    at process._tickCallback (internal/process/next_tick.js:98:9) code: 'ENOENT' }

Therefore, here I propose that `source` is changed to `sourcePath` and `target` to `targetPath` to protect others from this trap.
@malept malept merged commit 79e0910 into max-mapper:master Mar 25, 2020
@jonasjancarik
Copy link

Seems like this was overwritten by 7993cb8#diff-5a831ea67cf5cf8703b0de46901ab25bd191f56b320053be9332d9a3b0d01d15 - I was just now reading the README for the first time and I was also wondering what source was meant to be

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants