You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fix init_popen_io to leave behind a sane state (0 and 1 file
descriptors open), in order to prevent "Bad file descriptor"
errors. Also fix test_stdouterrin_setnull to restore stdin
state, while relying on capfd to do this for stdout and stderr.
The "Bad file descriptor" error doesn't trigger reliably
because it's triggered by garbage collection of the Popen2IO
instance returned from init_popen_io as shown in this job:
https://github.com/pytest-dev/execnet/actions/runs/7955155978/job/21716386705?pr=243
=================================== FAILURES ===================================
__________________ test_stdouterrin_setnull[main_thread_only] __________________
execmodel = <ExecModel 'main_thread_only'>
capfd = <_pytest.capture.CaptureFixture object at 0x7fba8c333990>
@pytest.mark.skipif("not hasattr(os, 'dup')")
def test_stdouterrin_setnull(execmodel, capfd):
gateway_base.init_popen_io(execmodel)
os.write(1, b"hello")
> os.read(0, 1)
E OSError: [Errno 9] Bad file descriptor
testing/test_basics.py:254: OSError
0 commit comments