don't pass -p for gunzip #1715

This commit is contained in:
Clinton Hall 2020-02-06 15:00:49 +13:00 committed by GitHub
commit 5359260996
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -131,6 +131,7 @@ def extract(file_path, output_destination):
else:
cmd = core.NICENESS + cmd
cmd2 = cmd
if not 'gunzip' in cmd: #gunzip doesn't support password
cmd2.append('-p-') # don't prompt for password.
p = Popen(cmd2, stdout=devnull, stderr=devnull, startupinfo=info) # should extract files fine.
res = p.wait()
@ -138,7 +139,7 @@ def extract(file_path, output_destination):
core.logger.info('EXTRACTOR: Extraction was successful for {file} to {destination}'.format
(file=file_path, destination=output_destination))
success = 1
elif len(passwords) > 0:
elif len(passwords) > 0 and not 'gunzip' in cmd:
core.logger.info('EXTRACTOR: Attempting to extract with passwords')
for password in passwords:
if password == '': # if edited in windows or otherwise if blank lines.