cannot zip file with zipfile

Ignacio Vazquez-Abrams ignacio at openservices.net
Tue Aug 21 16:23:46 EDT 2001


On Tue, 21 Aug 2001, Scott Hathaway wrote:

> I cannot seem to create a valid zip file (one that WinZip can open).  Here
> is my code:
>
> from zipfile import ZipFile
> a = ZipFile("c:\\test.zip","w",8)
> print a.write("c:\\test.txt")
>
> Can someone please tell me what am I doing wrong?
>
> Thanks,
> Scott

Are you close()ing the archive? According to the manual, "You must call
close() before exiting your program or essential records will not be
written."

-- 
Ignacio Vazquez-Abrams  <ignacio at openservices.net>






More information about the Python-list mailing list