smihica / pyminizip

To create a password encrypted zip file in python.
Other
106 stars 37 forks source link

pyminizip.compress_multiple seems to create password for each file #30

Open GioPetry opened 4 years ago

GioPetry commented 4 years ago

Hi There, here is my code:

for f in files:   

   to_zip.append(f) 

   to_zip_paths.append(path) 

pyminizip.compress_multiple(to_zip, to_zip_paths, 'backup_code.zip', '', 4) 

This way and with singular file compress works flawlessy, BUT if I change the last line adding a password like

pyminizip.compress_multiple(to_zip, to_zip_paths, 'backup_code.zip', '1234', 4) 

it acts really weird like it is asking the password for EACH FILE inside the folder; and it works just for the first one, if I type for the second it doesn't, look:

Schermata 2019-12-10 alle 12 56 21 Schermata 2019-12-10 alle 13 01 23

What's causing this? Thanks

N.B. Even in the cases it works I get this warning

DeprecationWarning: PY_SSIZE_T_CLEAN will be required for '#' formats
  pyminizip.compress_multiple(...
GioPetry commented 4 years ago

Well it seems it can only be extracted by command line, My bad

lordkrs commented 4 years ago

Even I am facing the same issue

WillianBR commented 3 years ago

I got this today, calling the UnZip().

# My import with alias
from pyminizip import (
        compress as ZipOne,
        compress_multiple as ZipMany,
        uncompress as UnZip)

# unzipping the file (single XLSX)
logger.error("Descompactando {} ...".format(zipFilename))
UnZip(zipFilename, ZipPWD, gettempdir(), 1)
if os.path.exists(xlsxFilename):
    logger.error("Criado {} ...".format(xlsxFilename))

My SYSOUT shows:

2021-01-20 13:21:40.418 | ERROR    | __main__:despachar_email_reiterando_preaprovacao:527 - Descompactando C:\Users\Willian\AppData\Local\Temp\PreApproval.20210119.zip ...
C:/Users/Willian/Projetos/inventario-digicert/__main__.py:528: DeprecationWarning: PY_SSIZE_T_CLEAN will be required for '#' formats
  UnZip(zipFilename, ZipPWD, gettempdir(), 1)
2021-01-20 13:21:40.418 | ERROR    | __main__:despachar_email_reiterando_preaprovacao:530 - Criado C:\Users\Willian\AppData\Local\Temp\PreApproval.20210119.xlsx ...

But the XLSX file is there. The UnZip works just fine! It still bother me this ugly Warning! I wanna strip it out!