Skip to content

🐛 fix(descriptor): define unavailable behavior#650

Merged
gaborbernat merged 1 commit into
mainfrom
fix/629-descriptor-enosys
Jul 14, 2026
Merged

🐛 fix(descriptor): define unavailable behavior#650
gaborbernat merged 1 commit into
mainfrom
fix/629-descriptor-enosys

Conversation

@gaborbernat

Copy link
Copy Markdown
Member

Python builds without fcntl selected the soft FileLock aliases but left the public caller-owned descriptor helpers bound to an unavailable name. Blocking descriptor calls also accepted non-positive and non-finite polling intervals, so invalid input could spin or fail after a native lock attempt. Issue #629 records both portability gaps.

When fcntl is unavailable, descriptor lock and unlock operations now raise OSError(errno.ENOSYS). Blocking calls reject non-finite or non-positive intervals before the first native attempt. Nonblocking calls retain one attempt and ignore the interval; that path skips time.sleep().

Valid intervals keep their current behavior, and FileLock plus AsyncFileLock continue to select soft implementations on builds without fcntl. Closes #629.

Descriptor helpers reached an unbound fcntl name on Python builds without that module. Blocking calls attempted the native operation before rejecting intervals that can spin or never progress.

Define ENOSYS primitives in the failed-import branch and validate finite positive intervals before the first blocking attempt. Nonblocking calls keep one native attempt and ignore the interval, preserving their existing contract.
@gaborbernat gaborbernat force-pushed the fix/629-descriptor-enosys branch from e3c2dda to ffcb2ed Compare July 14, 2026 03:03
@gaborbernat gaborbernat marked this pull request as ready for review July 14, 2026 03:10
@gaborbernat gaborbernat merged commit f300945 into main Jul 14, 2026
36 checks passed
@gaborbernat gaborbernat deleted the fix/629-descriptor-enosys branch July 14, 2026 04:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Define descriptor behavior without fcntl

1 participant