def close(self):
if self.closed:<EOL><INDENT>return<EOL><DEDENT>if self.mode in "<STR_LIT>":<EOL><INDENT>self.fileobj.write(NUL * (BLOCKSIZE * <NUM_LIT:2>))<EOL>self.offset += (BLOCKSIZE * <NUM_LIT:2>)<EOL>blocks, remainder = divmod(self.offset, RECORDSIZE)<EOL>if remainder > <NUM_LIT:0>:<EOL><INDENT>self.fileobj.write(NUL * (RECORDSIZE - remainder))<EOL><DEDENT><DEDENT>if not self._extfileobj:<EOL><INDENT>self.fileobj.close()<EOL><DEDENT>self.closed = True<EOL>
Close the TarFile. In write-mode, two finishing zero blocks are
           appended to the archive.