BadZipfile "file is not a zip file"

John Machin sjmachin at lexicon.net
Sat Jan 10 01:33:11 CET 2009


On Jan 10, 9:52 am, webcomm <rya... at gmail.com> wrote:
> On Jan 9, 5:21 pm, John Machin <sjmac... at lexicon.net> wrote:
>
> > Thanks. Would you mind spending a few minutes more on this so that we
> > can see if it's a problem that can be fixed easily, like the one that
> > Chris Mellon reported?
>
> Don't mind at all.  I'm now working with a zip file with some dummy
> data I downloaded from the web service.  You'll notice it's a smaller
> archive than the one I was working with when I ran zip_susser.py, but
> it has the same problem (whatever the problem is).

You mean it produces the same symptom. The zipfile.py has several
paths to the symptom i.e. the uninformative "bad zipfile" exception;
we don't know which path, yet. That's why Martin was suggesting that
you debug the sucker; that's why I'm trying to do it for you by remote
control. It is not impossible for a file with dummy data to have been
handcrafted or otherwise produced by a process different to that used
for a real-data file. Please run v2 of the gadget on the real-data zip
and report the results.

> It's the one I
> uploaded tohttp://webcomm.webfactional.com/htdocs/data.zip
>
> Here's what I get when I run zip_susser_v2.py...
>
> archive size is 1092
> FileHeader at 0
> CentralDir at 844
> EndArchive at 894
> using posEndArchive = 894
> endArchive: ('PK\x05\x06', 0, 0, 1, 1, 50, 844, 0)
>                         signature : 'PK\x05\x06'
>                     this_disk_num : 0
>              central_dir_disk_num : 0
> central_dir_this_disk_num_entries : 1
>   central_dir_overall_num_entries : 1
>                  central_dir_size : 50
>                central_dir_offset : 844
>                      comment_size : 0
>
> expected_comment_size: 0
> actual_comment_size: 176
> comment is all spaces: False
> comment is all '\0': True
> comment (first 100 bytes):
> '\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00
> \x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0­0\x00
> \x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0­0\x00
> \x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0­0\x00
> \x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0­0\x00
> \x00\x00\x00\x00\x00\x00\x00'
>
> Not sure if you've seen this thread...http://groups.google.com/group/comp.lang.python/browse_thread/thread/...

Yeah, I've seen it ... (sigh) ... pax Steve Holden, but *please* stick
with one thread ...





More information about the Python-list mailing list