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

Fix io error when extracing zip archive containing folders #68

Merged
merged 2 commits into from
Feb 24, 2021
Merged

Fix io error when extracing zip archive containing folders #68

merged 2 commits into from
Feb 24, 2021

Conversation

t-mw
Copy link
Contributor

@t-mw t-mw commented Feb 20, 2021

If a binary is contained in a folder in a zip archive (i.e. bin_path_in_archive has a prefix), extracting will fail with an io error "No such file or directory", because fs::File::create in Extract::extract_into and Extract::extract_path is passed the path of the binary including the zipped parent folder, which does not exist yet.

The commit adds tests for these cases and cleans up some existing tests.

If a binary is contained in a folder in a zip archive (i.e. `bin_path_in_archive` has a prefix),
extracting will fail with an io error "No such file or directory", because `fs::File::create` in
`Extract::extract_into` and `Extract::extract_path` is passed the path of the binary including the
zipped parent folder, which does not exist yet.

The commit adds tests for these cases and cleans up some existing tests.
Copy link
Owner

@jaemk jaemk left a comment

Choose a reason for hiding this comment

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

Thanks, looks good @t-mw - mind resolving the conflict before I merge?

#[cfg(not(feature = "archive-zip"))]
#[test]
#[ignore]
fn unpack_zip_file() {
Copy link
Owner

Choose a reason for hiding this comment

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

this needed or can it be deleted?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This function? The other tests do the same so I just copied them, but happy to remove it.

Copy link
Owner

@jaemk jaemk Feb 24, 2021

Choose a reason for hiding this comment

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

ah right, that's fine leaving it then

@jaemk jaemk merged commit b13c4a2 into jaemk:master Feb 24, 2021
@jaemk
Copy link
Owner

jaemk commented Feb 24, 2021

released in 0.25.0

@t-mw t-mw deleted the patch-1 branch February 24, 2021 03:04
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.

2 participants