utils.processoutput: reorder asyncio tasks#5480
Conversation
Try to drain the stdout/stderr streams first before handling the onexit task, so the overall result can be processed correctly
I can confirm it works now: --ffmpeg-no-validation is not needed anymore. |
Try to drain the stdout/stderr streams first before handling the onexit task, so the overall result can be processed correctly
Fixes #5461
The issue is caused by
process.wait()resolving first in theonexittask, so the result of thedonefuture gets set without the async interator(s) of the stdout/stderr stream(s) being drained in theonoutputtask(s) first.In my eyes, this looks like an issue in asyncio's subprocess implementation... No idea if this actually fixes #5461, but reordering the tasks at least made the added test pass while not reordering them made it fail.