Repository navigation
Propagate virtual audio read OSError to callers - #507
Open
wangjie-coding wants to merge 1 commit into
Open
wangjie-coding wants to merge 1 commit into
wangjie-coding wants to merge 1 commit into
Conversation
Owner
|
I don't understand the problem, nor the solution. Also, users of this library may depend on the error types we return, so this is a breaking change, which we should only do if there's a real and significant benefit. |
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.
Preserve OSError raised by a virtual file's read/readinto callback and
re-raise the original exception after libsndfile returns to Python.
Previously, CFFI reported the exception as unraisable and supplied a zero
return value, so an audio read could look like normal EOF.
Keep the first read failure per SoundFile, consume it before interpreting
the native result, and close any handle returned when opening fails due
to a read callback error. Leave the existing readinto fallback behavior
unchanged. This handles read callbacks during open and sample I/O;
it does not add error propagation for write/seek/tell callbacks.
Validation on Windows, CPython 3.12 and libsndfile 1.2.2:
adapters; mono/stereo PCM; header reads; non-seekable XI audio;
successful short reads, EOF, recovery, file isolation and collection.
with 16 pre-existing closed-file callback warnings.
as the baseline, with no new diagnostics.
The 71 file-descriptor cases were excluded using the project's documented
Windows workaround. Linux, PyPy and other libsndfile versions have not
been validated. This uses constructed failing adapters; no production
transport failure is claimed. Prepared with AI assistance.