Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[MRG] clean up zip error handling for bad zip files #2270

Merged
merged 2 commits into from
Sep 7, 2022

Conversation

ctb
Copy link
Contributor

@ctb ctb commented Sep 7, 2022

SaveSignatures_* and ZipStorage have some ugly and slightly broken error handling when trying to open a .zip file that is not, in fact, a valid zipfile. This made it hard to figure out what the actual error was!

This PR cleans up the error handling to present the user with a somewhat more useful error message.

Fixes #2269

@codecov
Copy link

codecov bot commented Sep 7, 2022

Codecov Report

Merging #2270 (924fc24) into latest (3880109) will increase coverage by 7.34%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##           latest    #2270      +/-   ##
==========================================
+ Coverage   84.84%   92.19%   +7.34%     
==========================================
  Files         131      100      -31     
  Lines       15662    11393    -4269     
  Branches     2248     2250       +2     
==========================================
- Hits        13289    10504    -2785     
+ Misses       2082      598    -1484     
  Partials      291      291              
Flag Coverage Δ
python 92.19% <100.00%> (+<0.01%) ⬆️
rust ?

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
src/sourmash/sbt_storage.py 89.18% <100.00%> (+0.03%) ⬆️
src/sourmash/sourmash_args.py 93.66% <100.00%> (+0.05%) ⬆️
src/core/tests/storage.rs
src/core/src/index/linear.rs
src/core/src/ffi/hyperloglog.rs
src/core/src/index/search.rs
src/core/src/sketch/hyperloglog/estimators.rs
src/core/src/ffi/utils.rs
src/core/tests/test.rs
src/core/src/storage.rs
... and 23 more

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@ctb
Copy link
Contributor Author

ctb commented Sep 7, 2022

ready for review @sourmash-bio/devs @dkoslicki!

Copy link
Member

@mr-eyes mr-eyes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@mr-eyes mr-eyes merged commit 569d212 into latest Sep 7, 2022
@mr-eyes mr-eyes deleted the clarify_zip_error branch September 7, 2022 16:54
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.

Bug: using -o with bad .zip file gives a terrible error messagae
2 participants