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

Add password options for 7z, zip, rar and arj #51

Merged
merged 6 commits into from
Jan 16, 2024

Conversation

sr-verde
Copy link

Closes #50

Since I want to use dtrx to extract archives in non-interactive mode, even if they are password protected, I started to write a patch to enable dtrx to do this. This PR is currently a draft because

  1. it only supports ZipExtractor, SevenExtractor and RarExtractor
  2. it uses f-strings, which are not supported in Python 2.7

If this draft seems good, I'd like to add password support for the other extractors as well (for those libraries that support encrypted archives).

Regarding f-strings: Shouldn't dtrx drop support for Python 2?

I'm happy to hear your comments!

@ChrisJefferson
Copy link

Thanks. This looks like a good direction! One useful thing to add would be tests for all the encrypted formats we want to support (the way tests are implemented isn't really documented, but it's (hopefully) not too hard to understand. The test will (I imagine) look a lot like a current test (could take the existing files and just add encryption?) -- the pass options:.

In terms of python 2, my preference would be to support it if it's not that difficult -- as dtrx is an "easy to use" end-user program, there are a bunch of people running old OSes which are still on Python 2, who use dtrx (I know a couple personally), who I wouldn't want to have to teach how to install Python 3.

Of course, if something turns out to be difficult to implement in Python 2, that would be a reason to abandon support.

@sr-verde
Copy link
Author

Thank you Chris for your quick response. I love dtrx for my daily work and it is also a great tool for automation. With the password option added I can use it as a full replacement for patool. That would be so good.

For this PR it is a no brainer to support py v2. I only noticed the v2 support after writing the code. Of course I will write tests as well.

@sr-verde sr-verde changed the title Add password option for 7z, zip and rar Add password options for 7z, zip, rar and arj Jul 12, 2023
@sr-verde sr-verde marked this pull request as ready for review July 12, 2023 14:18
@sr-verde
Copy link
Author

Okay, I've added the password option to unar and arj as well. And added some tests. I would appreciate your feedback if something is missing.

@ChrisJefferson
Copy link

Hi, just to say sorry I've been slow looking at this, life has gotten busy, but it is on my list to get to.

@DeflateAwning
Copy link

This would be great to get merged!

@sr-verde
Copy link
Author

Anything I can do to get this merged, @ChrisJefferson?

@ChrisJefferson ChrisJefferson merged commit bda685a into dtrx-py:master Jan 16, 2024
@ChrisJefferson
Copy link

Sorry for the delay, I tested and this all looks good.

@dilinger
Copy link

Just curious, what's the plan for a new release? I'd like to play around with this new feature, but if there's a planned release then I'll just wait for that so I can simultaneously update the debian package. @noahp

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.

[feature] Add option --password to provide a password
4 participants