[New-bugs-announce] [issue3535] zipfile has problem reading zip files over 2GB

alonwas report at bugs.python.org
Sun Aug 10 11:27:28 CEST 2008

New submission from alonwas <alon.was at gmail.com>:

zipfile complains about "Bad magic number for central directory" when I
give it files over 2GB. I believe the problem is that the offset for the
central directory should be read as an unsigned long rather than as a
signed long. Modifying structEndArchive from "<4s4H2lH" to "<4s4H2LH"
(note the capital L) should probably fix it. When the offset is >2^31
you get a negative offset and the code fails to find the central
directory. I'll appreciate it if someone more knowledgeable looks at the
problem and the suggested fix, Thanks, Alon

components: Library (Lib)
messages: 70968
nosy: alonwas
severity: normal
status: open
title: zipfile has problem reading zip files over 2GB
type: behavior
versions: Python 2.5

Python tracker <report at bugs.python.org>

More information about the New-bugs-announce mailing list