'Read the directory, making sure we close the file if the format
is bad.'

def _GetContents(self):

    try:
        self._RealGetContents()
    except BadZipfile:
        if (not self._filePassed):
            self.fp.close()
            self.fp = None
        raise
