BadZipfile "file is not a zip file"

webcomm ryandw at
Fri Jan 9 23:00:36 CET 2009

On Jan 8, 8:39 pm, "James Mills" <prolo... at> wrote:
> Send us a sample of this file in question...

Here's a sample with some dummy data from the web service:

That's the zip created in this line of my code...
f = open('', 'wb')

If I open the file it contains as unicode in my text editor (EditPlus)
on Windows XP, there is ostensibly nothing wrong with it.  It looks
like valid XML.  But if I return it to my browser with python+django,
there are bad characters every other character

If I unzip it like this...
...then the bad characters are 'FFFD' characters as described and
pictured here...

If I unzip it like this...
getzip('', ignoreable=30000)
...using Scott's function at...
...then the bad characters are \x00 characters.

More information about the Python-list mailing list