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