Skip to content

Explicitly close encoded file #755

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

NicolasHug
Copy link
Member

Fixes #724

I hope that this is the fix for the errors we're seeing in #724.:

FAILED test/test_encoders.py::TestAudioEncoder::test_num_channels[to_file-2-2] - RuntimeError: Could not open input file: /tmp/pytest-of-root/pytest-0/test_num_channels_to_file_2_2_0/output.mp3 Invalid data found when processing input

I think the error was that we were trying to read an encoded file that we had just encoded, and because that file wasn't fully close()ed yet, something was going wrong.

Hard to test for this. Let's monitor the repo and see if we still notice the same kind of issues.

@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Meta Open Source bot. label Jul 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Meta Open Source bot.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Encoder tests sometimes fail on reading input
2 participants