MCPcopy Create free account
hub / github.com/tox-dev/filelock / lstat

Function lstat

tests/soft/test_lease_finalization.py:135–142  ·  view source on GitHub ↗
(path: str | os.PathLike[str])

Source from the content-addressed store, hash-verified

133 misses: Final[itertools.count[int]] = itertools.count()
134
135 def lstat(path: str | os.PathLike[str]) -> os.stat_result:
136 if leases and os.fspath(path).endswith(marker.name):
137 # A single miss may be a peer's break in flight, so the loss only counts on the second.
138 if next(misses):
139 leases.clear()
140 gc.collect()
141 raise FileNotFoundError(ENOENT, "No such file or directory", marker.name)
142 return real_lstat(path)
143
144 def fstat(fd: int) -> os.stat_result | SimpleNamespace:
145 # The collected lease has closed its descriptor by the time the heartbeat inspects it.

Callers

nothing calls this directly

Calls 1

clearMethod · 0.80

Tested by

no test coverage detected