r"""
    base_fmtstr must have a %d in it

def get_nonconflicting_path_old(base_fmtstr, dpath, offset=0):
    r"""
    base_fmtstr must have a %d in it
    """
    import utool as ut
    from os.path import basename

    pattern = '*'
    dname_list = ut.glob(dpath, pattern, recursive=False,
                               with_files=True, with_dirs=True)
    conflict_set = set([basename(dname) for dname in dname_list])

    newname = ut.get_nonconflicting_string(base_fmtstr, conflict_set,
                                           offset=offset)
    newpath = join(dpath, newname)
    return newpath