Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def _extract(archive_path, destination):
"""
Extract archive content to destination.
:param archive_path: The archive to extract.
:param destination: The destination to extract to.
"""
# 'e': extract to current working dir.
# '-y': assume yes to all (overwrite).
process_info = [find_executable(config.EXTRACTION_EXECUTABLE), 'e', '-y', archive_path]
logger.debug('Running {}'.format(process_info))
# Change current working directory since 7Zip only works with e flag.
output = subprocess.check_output(process_info, cwd=destination)
logger.debug('Output: {}'.format(output))