cannot zip file with zipfile

Ignacio Vazquez-Abrams ignacio at
Tue Aug 21 22:23:46 CEST 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:\\","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

Ignacio Vazquez-Abrams  <ignacio at>

More information about the Python-list mailing list