[New-bugs-announce] [issue1003] zipfile password fails validation

David W report at bugs.python.org
Thu Aug 23 22:53:16 CEST 2007

New submission from David W:

This is in python2.5: zipfile.py SVN rev-56308
When testing a zipfile.Zipfile().read() with a password protected zip
file, I would continually get exceptions.  So I tracked this down to 
line 796-797: 
if ord(h[11]) != ((zinfo.CRC>>24)&255):
        raise RuntimeError, "Bad password for file %s" % name

scope related data:
bytes = `)¶G\x02ùû¬&\x1E#çÕ`
h[11] = `¯`
zinfo.CRC = `1554440319`

ord(h[11]) == 175
((zinfo.CRC>>24)&255) == 92

When I commented out the error check, the script extracted 150 JPGs with
no corruption or errors in any of the images...so its just seems like an
issue with the error check.

components: Library (Lib)
messages: 55210
nosy: djw
severity: normal
status: open
title: zipfile password fails validation
type: crash
versions: Python 2.5

Tracker <report at bugs.python.org>

More information about the New-bugs-announce mailing list