BadZipfile "file is not a zip file"

webcomm ryandw at
Fri Jan 9 15:59:36 CET 2009

On Jan 9, 3:16 am, Steven D'Aprano <st... at REMOVE-THIS-> wrote:
> The full signature of ZipFile is:
> ZipFile(file, mode="r", compression=ZIP_STORED, allowZip64=True)
> Try passing compression=zipfile.ZIP_DEFLATED and/or allowZip64=False and
> see if that makes any difference.

Those arguments didn't make a difference in my case.

> The zip format does support alternative compression methods, it's
> possible that this particular file uses a different sort of compression
> which Python doesn't deal with.
> > What would cause a zip file to not have a table of contents?
> What makes you think it doesn't have one?

Because when I search for the "file is not a zip file" error in, there is a function that checks for a table of contents.
Tho it looks like there are other ideas in this thread about what
might cause that error... I'll keep reading...

More information about the Python-list mailing list