-
Notifications
You must be signed in to change notification settings - Fork 26
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
Make encryption work with zip files #196
Conversation
This type inherits from OSError so ZipFile can still detect that the stream lacks seek support
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #196 +/- ##
==========================================
+ Coverage 44.66% 47.07% +2.41%
==========================================
Files 26 26
Lines 3401 3405 +4
==========================================
+ Hits 1519 1603 +84
+ Misses 1882 1802 -80
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
7eeabec
to
9079bdb
Compare
43950be
to
47ce747
Compare
47ce747
to
fb3037a
Compare
Windows pypy is failing:
Seems unrelated to this PR. |
acquire/tools/decrypter.py
Outdated
out_path: Path, | ||
key_file: Path | None = None, | ||
key_server: str | None = None, | ||
clobber=False, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
clobber=False, | |
clobber: bool = False, |
this is related to an issue in pypy, it ships a specific cffi version with it that wants to use a deprecated function inside distutils. It should be fixed when a new pypy3.10 gets released |
acquire/tools/decrypter.py
Outdated
@@ -480,7 +494,7 @@ def main(): | |||
elif not all(successes): | |||
exit_code = 2 | |||
# Else, if all were successful but there were still tasks to handle, return 2 | |||
elif all(success) and tasks: | |||
elif success and tasks: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is not specifically a comment on your change, but i don't understand why success is here to begin with
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You are absolutely right.
I think the original author meant all(successes)
.
This is superfluous, because we know at this point that not all(successes) == False
,
which implies that all(successes) == True
.
I also changed the exit_code to 3 in this case.
Not sure what the author intended, but otherwise he would probably have written not all(sucesses) or tasks
in the second condition.
(Arbitrary in any case).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indeed, all(successes)
is not needed there, I think the all(success)
is a residu of changing code around. At the end, you just need to check if there are still tasks to be handled, while the handled tasks are all successful.
I also agree with changing the exit code to 3.
Fix encryption in combination with zip files:
ZipFile
.Bonus:
all()
on a boolean)Closes #195