dtrx-py / dtrx

Do The Right Extraction
GNU General Public License v3.0
224 stars 10 forks source link

Bug: extracting a zip file with 2 identically-named files fails waiting for input to the `zip` command #57

Open DeflateAwning opened 4 months ago

DeflateAwning commented 4 months ago

Apparently zip files can somehow contain 2 files with the same filename (and thus same path in the zip file). The zip command tries to prompt the user for an action.

Here is an example of a file that does not work in dtrx: identical_names_same_dir.zip

Fix Options

ChrisJefferson commented 4 months ago

Wow, I had no idea it was possible to make such a thing. I agree it should be handled, PRs welcome if you feel comfortable tackling this!

DeflateAwning commented 4 months ago

I took a look into it, but couldn't get a hold of how configuration/CLI args are passed around ("policy"). I think it's probably best if someone else tackles it.

As a local hack, I just added the -n flag to the unzip command. I think the best-case is making it so that it uses -o if the user has the overwrite flag, and -n otherwise (or maybe prompt for the overwrite/ignore/rename thing).

Make sure to add an integration test for that specific file as well!