MCPcopy Create free account
hub / github.com/libgit2/pygit2 / rmtree

Function rmtree

test/utils.py:98–103  ·  view source on GitHub ↗

In Windows a read-only file cannot be removed, and shutil.rmtree fails. So we implement our own version of rmtree to address this issue.

(path: str | Path)

Source from the content-addressed store, hash-verified

96
97
98def rmtree(path: str | Path) -> None:
99 """In Windows a read-only file cannot be removed, and shutil.rmtree fails.
100 So we implement our own version of rmtree to address this issue.
101 """
102 if Path(path).exists():
103 shutil.rmtree(path, onerror=force_rm_handle)
104
105
106def diff_safeiter(diff: pygit2.Diff) -> Iterator[pygit2.Patch]:

Callers

nothing calls this directly

Calls 1

existsMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…