stderr is opened here but not explicitly closed (here?).
How to reproduce
Add the following test to test_io.py and run (tested on Windows 10, Python 3.8):
def test_read_frames_resource_warning():
with pytest.warns(None) as warnings:
gen = imageio_ffmpeg.read_frames(test_file1)
next(gen)
gen.close()
# there should not be any warnings, but show warning messages if there are
assert not [w.message for w in warnings]
Description
read_frames.close()
leads to aResourceWarning: unclosed file
, e.g. when runningunittest
tests.This implies that the standard streams are not being closed properly, similar to https://github.com/imageio/imageio/issues/697:
stderr
is opened here but not explicitly closed (here?).How to reproduce
Add the following test to
test_io.py
and run (tested on Windows 10, Python 3.8):