Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Produce more helpful error messages when reading from file-like objects that have been seeked. #210

Merged
merged 1 commit into from
Mar 23, 2023

Conversation

psobot
Copy link
Member

@psobot psobot commented Mar 20, 2023

(cc @CWFred)

Pedalboard supports reading audio from file-like objects. If a file-like object is provided but its position is not at index 0 (i.e.: it has been seek-ed or written to without seeking back to the start), Pedalboard will throw an unhelpful ValueError:

Failed to open audio file-like object: <_io.BytesIO object at 0x7fd1983f6a40> does not seem to contain a known or supported format. 

This PR changes the error message to indicate that the provided file-like object is at its end, or seeked to some other point along its length.

@psobot psobot added the enhancement New feature or request label Mar 20, 2023
@psobot psobot marked this pull request as ready for review March 23, 2023 14:18
@psobot psobot merged commit c35f323 into master Mar 23, 2023
@psobot psobot deleted the psobot/better-error-message-when-reading-streams branch March 23, 2023 19:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant