def generate_tarinfo(tar):
    """ Generate all members of TarFile. Members are discarded after each iteration """
    while True:
        info = tar.next()
        if info:
            yield info
            tar.members = []
        else:
            return
