'Verify the signature on the contents of the file-like object \'file\''

def verify_file(self, file, data_filename=None):

    logger.debug('verify_file:    %r,    %r', file, data_filename)
    result = self.result_map['verify'](self)
    args = ['--verify']
    if (data_filename is None):
        self._handle_io(args, file, result, binary=True)
    else:
        logger.debug('Handling    detached    verification')
        import tempfile
        (fd, fn) = tempfile.mkstemp(prefix='pygpg')
        s = file.read()
        file.close()
        logger.debug('Wrote    to    temp    file:    %r', s)
        os.write(fd, s)
        os.close(fd)
        args.append(fn)
        args.append(('"%s"' % data_filename))
        try:
            p = self._open_subprocess(args)
            self._collect_output(p, result, stdin=p.stdin)
        finally:
            os.unlink(fn)
    return result
