def _writecheck(self, zinfo):
if zinfo.filename in self.NameToInfo:<EOL><INDENT>if self.debug:      <EOL><INDENT>print("<STR_LIT>", zinfo.filename)<EOL><DEDENT><DEDENT>if self.mode not in ("<STR_LIT:w>", "<STR_LIT:a>"):<EOL><INDENT>raise RuntimeError('<STR_LIT>')<EOL><DEDENT>if not self.fp:<EOL><INDENT>raise RuntimeError("<STR_LIT>")<EOL><DEDENT>if zinfo.compress_type == ZIP_DEFLATED and not zlib:<EOL><INDENT>raise RuntimeError("<STR_LIT>")<EOL><DEDENT>if zinfo.compress_type not in (ZIP_STORED, ZIP_DEFLATED):<EOL><INDENT>raise RuntimeError("<STR_LIT>")<EOL><DEDENT>if zinfo.file_size > ZIP64_LIMIT:<EOL><INDENT>if not self._allowZip64:<EOL><INDENT>raise LargeZipFile("<STR_LIT>")<EOL><DEDENT><DEDENT>if zinfo.header_offset > ZIP64_LIMIT:<EOL><INDENT>if not self._allowZip64:<EOL><INDENT>raise LargeZipFile("<STR_LIT>")<EOL><DEDENT><DEDENT>
Check for errors before writing a file to the archive.