This is the code :
"""
To decrypt a zipfile which has a password.
"""
import os
import zipfile
file_zip = zipfile.ZipFile('dict.zip')
file_zip.extractall(pwd="456789")
file_zip.close()
'456789' is the right password but I got a 'Bad password for file' error. I have tried many different passwords and files but every time I'm faced with this error. I can't seem to figure out the reason.