(self)
| 201 | os.close(fd) # another holder owns the byte-range lock; let the retry loop try again |
| 202 | |
| 203 | def _release(self) -> None: |
| 204 | fd = cast("int", self._context.lock_file_fd) |
| 205 | # Retain the descriptor until the OS unlock succeeds: if UnlockFileEx raises, the byte-range lock is still |
| 206 | # held, so is_locked must keep reporting held rather than losing the fd. Only after the unlock commits do |
| 207 | # close and unlink run as post-unlock cleanup; their failure cannot make the lock held again. |
| 208 | _unlock_fd(fd) |
| 209 | self._mark_descriptor_released() |
| 210 | self._close_released_fd(fd, default_suppresses=False) |
| 211 | if not self._preserve_lock_file: # preserve_lock_file keeps a stable file identity for the caller (#605) |
| 212 | with suppress(OSError): |
| 213 | Path(self.lock_file).unlink() |
| 214 | |
| 215 | def _open_non_reparse_fd(path: str, mode: int) -> int | None: |
| 216 | """ |
nothing calls this directly
no test coverage detected