Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/tox-dev/filelock
/ functions
Functions
117 in github.com/tox-dev/filelock
⨍
Functions
117
◇
Types & classes
25
↳
Endpoints
2
↓ 21 callers
Method
acquire
Try to acquire the file lock. :param timeout: maximum wait time for acquiring the lock, ``None`` means use the default :attr:`~timeo
src/filelock/_api.py:271
↓ 15 callers
Method
release
Releases the file lock. Please note, that the lock is only completely released, if the lock counter is 0. Also note, that the lock fi
src/filelock/_api.py:350
↓ 4 callers
Method
join
(self, timeout: float | None = None)
tests/test_filelock.py:235
↓ 3 callers
Method
__init__
(self, target: Callable[[], None], name: str)
tests/test_filelock.py:225
↓ 3 callers
Function
ensure_directory_exists
Ensure the directory containing the file exists (create it if necessary). :param filename: file.
src/filelock/_util.py:39
↓ 3 callers
Method
release
Releases the file lock. Please note, that the lock is only completely released, if the lock counter is 0. Also note, that the lock fi
src/filelock/asyncio.py:248
↓ 2 callers
Method
_run_internal_method
(self, method: Callable[[], Any])
src/filelock/asyncio.py:267
↓ 2 callers
Function
make_ro
(path: Path)
tests/test_filelock.py:59
↓ 2 callers
Function
raise_on_not_writable_file
Raise an exception if attempting to open the file for writing would fail. This is done so files that will never be writable can be separated
src/filelock/_util.py:10
↓ 1 callers
Method
_acquire
If the file lock could be acquired, self._context.lock_file_fd holds the file descriptor of the lock file.
src/filelock/_api.py:245
↓ 1 callers
Function
_check_file_read_write
(txt_file: Path)
tests/test_filelock.py:614
↓ 1 callers
Method
_release
Releases the lock and sets self._context.lock_file_fd to None.
src/filelock/_api.py:250
↓ 1 callers
Method
_release
(self)
tests/test_async_filelock.py:170
↓ 1 callers
Method
acquire
Try to acquire the file lock. :param timeout: maximum wait time for acquiring the lock, ``None`` means use the default :
src/filelock/asyncio.py:180
↓ 1 callers
Function
decorated_method
()
tests/test_filelock.py:504
↓ 1 callers
Method
is_thread_local
:return: a flag indicating if this lock is thread local or not
src/filelock/_api.py:191
↓ 1 callers
Method
run_in_executor
::return: whether run in executor.
src/filelock/asyncio.py:155
Method
__aenter__
(self)
src/filelock/asyncio.py:58
Method
__aenter__
Acquire the lock. :return: the lock object
src/filelock/asyncio.py:288
Method
__aexit__
( # noqa: D105 self, exc_type: type[BaseException] | None, exc_value: BaseException |
src/filelock/asyncio.py:61
Method
__aexit__
Release the lock. :param exc_type: the exception type if raised :param exc_value: the exception value if raised :par
src/filelock/asyncio.py:298
Method
__call__
( # noqa: PLR0913 cls, lock_file: str | os.PathLike[str], timeout: float = -1,
src/filelock/_api.py:82
Method
__call__
( # type: ignore[override] # noqa: PLR0913 cls, # noqa: N805 lock_file: str | os.PathLike[st
src/filelock/asyncio.py:71
Method
__del__
Called when the lock object is deleted.
src/filelock/_api.py:395
Method
__del__
Called when the lock object is deleted.
src/filelock/asyncio.py:314
Method
__enter__
(self)
src/filelock/_api.py:39
Method
__enter__
Acquire the lock. :return: the lock object
src/filelock/_api.py:369
Method
__enter__
Replace old __enter__ method to avoid using it. NOTE: DO NOT USE `with` FOR ASYNCIO LOCKS, USE `async with` INSTEAD. :retur
src/filelock/asyncio.py:276
Method
__exit__
( self, exc_type: type[BaseException] | None, exc_value: BaseException | None,
src/filelock/_api.py:42
Method
__exit__
Release the lock. :param exc_type: the exception type if raised :param exc_value: the exception value if raised :par
src/filelock/_api.py:379
Method
__init__
(self, lock: BaseFileLock)
src/filelock/_api.py:36
Method
__init__
Create a new lock object. :param lock_file: path to the file :param timeout: default timeout when acquiring the lock, in sec
src/filelock/_api.py:152
Method
__init__
(self, lock_file: str)
src/filelock/_error.py:9
Method
__init__
(self, lock: BaseAsyncFileLock)
src/filelock/asyncio.py:55
Method
__init__
Create a new lock object. :param lock_file: path to the file :param timeout: default timeout when acquiring the lock, in sec
src/filelock/asyncio.py:104
Method
__init__
( self, lock_file: str | os.PathLike[str], timeout: float = -1,
tests/test_filelock.py:683
Method
__init__
( self, lock_file: str | os.PathLike[str], timeout: float = -1,
tests/test_filelock.py:699
Method
__init__
(self, file_path: str)
tests/test_filelock.py:809
Method
__init_subclass__
Setup unique state for lock subclasses.
src/filelock/_api.py:147
Method
__reduce__
(self)
src/filelock/_error.py:13
Method
__repr__
(self)
src/filelock/_error.py:19
Method
__str__
(self)
src/filelock/_error.py:16
Method
_acquire
(self)
src/filelock/_unix.py:20
Method
_acquire
(self)
src/filelock/_windows.py:19
Method
_acquire
(self)
src/filelock/_soft.py:16
Method
_acquire
(self)
tests/test_async_filelock.py:165
Method
_release
(self)
src/filelock/_unix.py:23
Method
_release
(self)
src/filelock/_windows.py:42
Method
_release
(self)
src/filelock/_soft.py:37
Method
blocking
:return: whether the locking is blocking or not
src/filelock/_api.py:225
Method
executor
::return: the executor.
src/filelock/asyncio.py:160
Method
is_locked
:return: A boolean indicating if the lock file is holding the lock currently. .. versionchanged:: 2.0.0 This was previ
src/filelock/_api.py:255
Method
is_singleton
:return: a flag indicating if this lock is singleton or not
src/filelock/_api.py:196
Method
lock_counter
:return: The number of times this lock has been acquired (but not yet released).
src/filelock/_api.py:267
Method
lock_file
:return: path to the lock file
src/filelock/_api.py:201
Method
lock_file
:return: The path of the file lock.
src/filelock/_error.py:23
Method
loop
::return: the event loop.
src/filelock/asyncio.py:176
Function
mess_with_file
(lock_: BaseFileLock)
tests/test_filelock.py:623
Method
mode
:return: the file permissions for the lockfile
src/filelock/_api.py:240
Method
resolve_xref
( # noqa: PLR0913, PLR0917 self, env: BuildEnvironment, fromdocname: str,
docs/conf.py:58
Method
run
(self)
tests/test_filelock.py:229
Function
setup
Setup app. :param app: the app
docs/conf.py:49
Function
t_1
()
tests/test_filelock.py:268
Function
t_2
()
tests/test_filelock.py:274
Function
test_acquire
( lock_type: type[BaseAsyncFileLock], path_type: type[str | Path], filename: str, tmp_path: Pa
tests/test_async_filelock.py:47
Function
test_acquire_release_on_exc
(lock_type: type[BaseFileLock], tmp_path: Path)
tests/test_filelock.py:435
Function
test_bad_lock_file
( lock_type: type[BaseFileLock], expected_error: type[Exception], match: str, bad_lock_file: s
tests/test_filelock.py:129
Function
test_cleanup_soft_lock
(tmp_path: Path)
tests/test_filelock.py:474
Function
test_context_decorator
(lock_type: type[BaseFileLock], tmp_path: Path)
tests/test_filelock.py:499
Function
test_context_release_on_exc
(lock_type: type[BaseFileLock], tmp_path: Path)
tests/test_filelock.py:420
Function
test_coroutine_function
(tmp_path: Path)
tests/test_async_filelock.py:161
Function
test_default_timeout
(lock_type: type[BaseFileLock], tmp_path: Path)
tests/test_filelock.py:388
Function
test_del
(lock_type: type[BaseFileLock], tmp_path: Path)
tests/test_filelock.py:451
Function
test_file_lock_positional_argument
(tmp_path: Path)
tests/test_filelock.py:807
Function
test_flock_not_implemented_unix
(tmp_path: Path, mocker: MockerFixture)
tests/test_filelock.py:602
Function
test_lock_can_be_non_thread_local
( tmp_path: Path, lock_type: type[BaseFileLock], )
tests/test_filelock.py:665
Function
test_lock_mode
(tmp_path: Path)
tests/test_filelock.py:512
Function
test_lock_mode_soft
(tmp_path: Path)
tests/test_filelock.py:531
Function
test_nested_acquire
(lock_type: type[BaseFileLock], tmp_path: Path)
tests/test_filelock.py:165
Function
test_nested_context_manager
(lock_type: type[BaseFileLock], tmp_path: Path)
tests/test_filelock.py:142
Function
test_nested_contruct
(lock_type: type[BaseFileLock], tmp_path: Path)
tests/test_filelock.py:205
Function
test_nested_forced_release
(lock_type: type[BaseFileLock], tmp_path: Path)
tests/test_filelock.py:188
Function
test_non_blocking
(lock_type: type[BaseFileLock], tmp_path: Path)
tests/test_filelock.py:319
Function
test_non_blocking
(lock_type: type[BaseAsyncFileLock], tmp_path: Path)
tests/test_async_filelock.py:77
Function
test_non_executor
(lock_type: type[BaseAsyncFileLock], thread_local: bool, tmp_path: Path)
tests/test_async_filelock.py:151
Function
test_poll_intervall_deprecated
(lock_type: type[BaseFileLock], tmp_path: Path)
tests/test_filelock.py:484
Function
test_ro_file
(lock_type: type[BaseFileLock], tmp_file_ro: Path)
tests/test_filelock.py:97
Function
test_ro_folder
(lock_type: type[BaseFileLock], tmp_path_ro: Path)
tests/test_filelock.py:78
Function
test_simple
( lock_type: type[BaseFileLock], path_type: type[str | Path], filename: str, tmp_path: Path,
tests/test_filelock.py:30
Function
test_simple
( lock_type: type[BaseAsyncFileLock], path_type: type[str | Path], filename: str, tmp_path: Pa
tests/test_async_filelock.py:15
Function
test_singleton_and_non_singleton_locks_are_distinct
(lock_type: type[BaseFileLock], tmp_path: Path)
tests/test_filelock.py:715
Function
test_singleton_instance_tracking_is_unique_per_subclass
(lock_type: type[BaseFileLock])
tests/test_filelock.py:778
Function
test_singleton_locks_are_deleted_when_no_external_references_exist
( lock_type: type[BaseFileLock], tmp_path: Path, )
tests/test_filelock.py:764
Function
test_singleton_locks_are_distinct_per_lock_file
(lock_type: type[BaseFileLock], tmp_path: Path)
tests/test_filelock.py:735
Function
test_singleton_locks_are_the_same
(lock_type: type[BaseFileLock], tmp_path: Path)
tests/test_filelock.py:726
Function
test_singleton_locks_must_be_initialized_with_the_same_args
(lock_type: type[BaseFileLock], tmp_path: Path)
tests/test_filelock.py:745
Function
test_singleton_locks_when_inheriting_init_is_called_once
(tmp_path: Path)
tests/test_filelock.py:790
Function
test_soft_errors
(tmp_path: Path, mocker: MockerFixture)
tests/test_filelock.py:608
Function
test_subclass_compatibility
(tmp_path: Path)
tests/test_filelock.py:681
Function
test_thrashing_with_thread_pool_global_lock
(tmp_path: Path, lock_type: type[BaseFileLock])
tests/test_filelock.py:635
next →
1–100 of 117, ranked by callers