Magic test for archives with zero-length entry #70
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Noticed when attempting to unpack a python
.whlwheel file;They're just renamed .zip's, and usually work OK, but there are casess
where the first file in the
.whlarchive is zero bytes, and thatcauses
file -zto error:❯ file -zL tests/test-1.23.zip tests/test-1.23.zip: ERROR:[gzip: ] (data) ❯ file tests/test-1.23.zip tests/test-1.23.zip: Zip archive data, made by v2.3 UNIX, extract using at least v1.0, last modified Oct 28 2006 14:38:44, uncompressed size 0, method=store ❯ unzip -l tests/test-1.23.zip Archive: tests/test-1.23.zip Length Date Time Name --------- ---------- ----- ---- 0 2006-10-28 14:38 1/2/3 0 2006-10-28 14:38 a/b 0 2006-10-28 14:38 foobar --------- ------- 0 3 filesThis means we were not using
filemagic for any archive that startedwith a zero-length file (or directory) entry.
Add a fallback when the magic test fails in this case, and add a test to
cover it.