🐛 fix(descriptor): define unavailable behavior#650
Merged
Conversation
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.
e3c2dda to
ffcb2ed
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Python builds without
fcntlselected the softFileLockaliases 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
fcntlis unavailable, descriptor lock and unlock operations now raiseOSError(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 skipstime.sleep().Valid intervals keep their current behavior, and
FileLockplusAsyncFileLockcontinue to select soft implementations on builds withoutfcntl. Closes #629.