You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Using file-sniff with node v6 leads to the inability to open valid gzip compressed files.
Errors look like:
# [tif+gz] Sniffing file: should return tif+gz filetype
not ok 89 no error
---
operator: error
expected: undefined
actual: { code: 'EINVALID' }
stack:
Error: Unknown filetype
at invalid (/Users/dane/projects/mapbox-file-sniff/lib/invalid.js:2:52)
at /Users/dane/projects/mapbox-file-sniff/index.js:80:34
at Gunzip.onError (zlib.js:212:5)
at emitOne (events.js:96:13)
at Gunzip.emit (events.js:188:7)
at Zlib._handle.onerror (zlib.js:373:10)
...
not ok 90 filetype: undefined
---
operator: equal
expected: 'tif+gz'
actual: undefined
...
# [serialtiles] Sniffing file: should return serialtiles filetype and serialtiles protocol
not ok 91 Error: Unknown filetype
---
operator: error
expected: undefined
actual: { code: 'EINVALID' }
stack:
Error: Unknown filetype
at invalid (/Users/dane/projects/mapbox-file-sniff/lib/invalid.js:2:52)
at /Users/dane/projects/mapbox-file-sniff/index.js:80:34
at Gunzip.onError (zlib.js:212:5)
at emitOne (events.js:96:13)
at Gunzip.emit (events.js:188:7)
at Zlib._handle.onerror (zlib.js:373:10)
...
# [serialtiles] Sniffing file: should return serialtiles filetype and serialtiles protocol
not ok 92 Error: Unknown filetype
---
operator: error
expected: undefined
actual: { code: 'EINVALID' }
stack:
Error: Unknown filetype
at invalid (/Users/dane/projects/mapbox-file-sniff/lib/invalid.js:2:52)
at /Users/dane/projects/mapbox-file-sniff/index.js:80:34
at Gunzip.onError (zlib.js:212:5)
at emitOne (events.js:96:13)
at Gunzip.emit (events.js:188:7)
at Zlib._handle.onerror (zlib.js:373:10)
...
# [tm2z] Sniffing file: should return tm2z filetype and tm2z protocol
not ok 93 Error: Unknown filetype
---
operator: error
expected: undefined
actual: { code: 'EINVALID' }
stack:
Error: Unknown filetype
at invalid (/Users/dane/projects/mapbox-file-sniff/lib/invalid.js:2:52)
at /Users/dane/projects/mapbox-file-sniff/index.js:80:34
at Gunzip.onError (zlib.js:212:5)
at emitOne (events.js:96:13)
at Gunzip.emit (events.js:188:7)
at Zlib._handle.onerror (zlib.js:373:10)
...
# [tm2z] Sniffing file with extended header: should return tm2z filetype and tm2z protocol
not ok 94 Error: Unknown filetype
---
operator: error
expected: undefined
actual: { code: 'EINVALID' }
stack:
Error: Unknown filetype
at invalid (/Users/dane/projects/mapbox-file-sniff/lib/invalid.js:2:52)
at /Users/dane/projects/mapbox-file-sniff/index.js:80:34
at Gunzip.onError (zlib.js:212:5)
at emitOne (events.js:96:13)
at Gunzip.emit (events.js:188:7)
at Zlib._handle.onerror (zlib.js:373:10)
...
The problem is that node v6 became more strict in how it handles and throws gunzip errors (nodejs/node#5883) and our method of only reading part of the gzip'd file is breaking now.
The text was updated successfully, but these errors were encountered:
By default, the zlib methods with throw an error when decompressing truncated data. However, if it is known that the data is incomplete, or the desire is to inspect only the beginning of a compressed file, it is possible to suppress the default error handling by changing the flushing method that is used to compressed the last chunk of input data:
from https://nodejs.org/api/zlib.html, indicates { finishFlush: zlib.Z_SYNC_FLUSH } is needed to do this, which we likely should have been doing all along.
Using file-sniff with node v6 leads to the inability to open valid
gzip
compressed files.Errors look like:
The problem is that node v6 became more strict in how it handles and throws gunzip errors (nodejs/node#5883) and our method of only reading part of the gzip'd file is breaking now.
The text was updated successfully, but these errors were encountered: