Skip to content
Advertisement

Pyminizip prompting password only for the first time

I am trying to password protect my zip file(with multiple txt files) using pyminizip.commpress_multiple

pyminizip.compress_multiple(["dummy.txt", "dummy1.txt"], [], "myzip.zip", "password", 9)

This is creating a password-protected zip file. When I try to extract the zip file for the first time it is prompting for the password.

From the second time onwards, it is not asking for the password.

Any ideas why this is happening ???

Thanks in advance.

Advertisement

Answer

The reason for not asking password second time is because when you right-click on "Extract files" then Windows remembers password after you first entering it. So second time Windows automatically uses remembered password.

Windows always tries to remember different kind of information for use, not to bother user extra time.

In this case Windows remembers password only by full path of this zip file. You can try moving file to a different folder, or renaming file, or even renaming folder that this file is contained in. In all cases Windows will ask for the password again.

Also Windows remembers password only for some time, definitely if you reboot Windows then it will forget and ask password again.

I tried reproducing your problem on my Windows and it acted totally same on my machine, I created archive with your Python code and then Extract files didn’t ask for password on second try.

User contributions licensed under: CC BY-SA
3 People found this is helpful
Advertisement