There seems to be no way to do this using the zipfile module. I solved this using the subprocess module:
from subprocess import check_output, CalledProcessError, STDOUT
try:
check_output(['unzip', '-q', my_zipfile, '-d', destination], stderr=STDOUT)
...
except CalledProcessError as err:
(use err.cmd, err.returncode and err.output to take action)
source
share