Problem with zipfile between 32-bit and 64-bit

John Wiegley johnw at gnu.org
Thu Aug 16 18:14:14 EDT 2001


Using the test script below, run it once on an Intel 32-bit platform.
This produces test.zip, which extracts hello.py.

Then take the test script and test.zip to an ia64 platform, and run it
again.  The file it extracts has 0 bytes.

I've run into other problems between ia32 and ia64, such as bad
checksums, and was wondering if anyone knew anything about this?

Thanks,
  John Wiegley <johnw at gnu.org>

----[ file: ziptest.py ]----------------------------------------------
import os
import zipfile
import string

if not os.path.exists('test.zip'):
    zip = zipfile.ZipFile('test.zip', 'w')
    zip.write('ziptest.py', 'hello.py')
    zip.close()

zip = zipfile.ZipFile('test.zip', 'r')
if hasattr(zip, 'namelist'):
    files = zip.namelist()
else:
    files = zip.listdir()

for file in files:
    file = apply(os.path.join, string.split(file, '\\'))

    data = open(file, 'wb')
    print "unarchiving", file
    data.write(zip.read(file))
    data.close()



More information about the Python-list mailing list