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

Function open_no_creat

tests/test_filelock.py:1056–1061  ·  view source on GitHub ↗
(path: str, flags: int, mode: int = 0o777, *, dir_fd: int | None = None)

Source from the content-addressed store, hash-verified

1054 call_count = 0
1055
1056 def open_no_creat(path: str, flags: int, mode: int = 0o777, *, dir_fd: int | None = None) -> int:
1057 nonlocal call_count
1058 call_count += 1
1059 if call_count == 1 and flags & os.O_CREAT:
1060 raise PermissionError(13, "Permission denied", path)
1061 return real_open(path, flags, mode) if dir_fd is None else real_open(path, flags, mode, dir_fd=dir_fd)
1062
1063 mocker.patch("os.open", side_effect=open_no_creat)
1064 lock.acquire()

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…