Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions docs/changelog/733.doc.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Correct the ``blocking`` parameter of :meth:`~filelock.BaseFileLock.acquire`: it does not default to ``True``, it defaults to ``None``, which means use the lock's :attr:`~filelock.BaseFileLock.blocking` attribute.
5 changes: 3 additions & 2 deletions src/filelock/_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -997,8 +997,9 @@ def acquire(
:param poll_interval: interval of trying to acquire the lock file, ``None`` means use the default
:attr:`~poll_interval`
:param poll_intervall: deprecated, kept for backwards compatibility, use ``poll_interval`` instead
:param blocking: defaults to True. If False, function will return immediately if it cannot obtain a lock on the
first attempt. Otherwise, this method will block until the timeout expires or the lock is acquired.
:param blocking: whether to block until the lock is acquired, ``None`` means use the default
:attr:`~blocking`. If ``False``, this method returns immediately if it cannot obtain a lock on the first
attempt. Otherwise, this method will block until the timeout expires or the lock is acquired.
:param cancel_check: a callable returning ``True`` when the acquisition should be canceled. Checked on each poll
iteration. When triggered, raises :class:`~Timeout` just like an expired timeout.

Expand Down
5 changes: 3 additions & 2 deletions src/filelock/asyncio.py
Original file line number Diff line number Diff line change
Expand Up @@ -266,8 +266,9 @@ async def acquire( # ty: ignore[invalid-method-override]
until the lock could be acquired
:param poll_interval: interval of trying to acquire the lock file, ``None`` means use the default
:attr:`~BaseFileLock.poll_interval`
:param blocking: defaults to True. If False, function will return immediately if it cannot obtain a lock on the
first attempt. Otherwise, this method will block until the timeout expires or the lock is acquired.
:param blocking: whether to block until the lock is acquired, ``None`` means use the default
:attr:`~BaseFileLock.blocking`. If ``False``, this method returns immediately if it cannot obtain a lock
on the first attempt. Otherwise, this method will block until the timeout expires or the lock is acquired.
:param cancel_check: a callable returning ``True`` when the acquisition should be canceled. Checked on each poll
iteration. When triggered, raises :class:`~Timeout` just like an expired timeout.

Expand Down