def build_zipmanifest(path):
 zipinfo = dict()
 zfile = zipfile.ZipFile(path)
 try:
  for zitem in zfile.namelist():
   zpath = zitem.replace('/', os.sep)
   zipinfo[zpath] = zfile.getinfo(zitem)
   assert (zipinfo[zpath] is not None)
 finally:
  zfile.close()
 return zipinfo

def build_zipmanifest ( path ) : zipinfo = dict ( ) zfile = zipfile . ZipFile ( path ) try : for zitem in zfile . namelist ( ) : zpath = zitem . replace ( '/' , os . sep ) zipinfo [ zpath ] = zfile . getinfo ( zitem ) assert ( zipinfo [ zpath ] is not None ) finally : zfile . close ( ) return zipinfo
this builds a similar dictionary to the zipimport directory caches .