def subpaths(path):

    def append_deeper(acc, name):
        return acc + [acc[-1] + os.sep + name]

    drive, dirs = os.path.splitdrive(path)
    dirs = dirs.split(os.sep)
    if os.path.isfile(path):
        dirs = dirs[:-1]

    paths = reduce(append_deeper, dirs, [''])[1:]
    paths = [d[1:] if d.startswith(os.sep+os.sep) else d for d in paths]
    paths = [drive + d for d in paths]

    paths.reverse()
    return paths
Release a write-lock.
dataset/ETHPy150Open blitzrk/sublime_libsass/libsass/pathutils.py/subpaths--crossover with--dataset/ETHPy150Open Knewton/pettingzoo-python/pettingzoo/utils.py/ReadWriteLock.release_write