https://github.com/python/cpython/commit/1b10efad66e9a0b72aae82de23074eafa49ec4db
commit: 1b10efad66e9a0b72aae82de23074eafa49ec4db
branch: main
author: Sam Gross <[email protected]>
committer: colesbury <[email protected]>
date: 2024-04-11T21:35:46Z
summary:

gh-117649: Fix file descriptor leak in (expected) failing test case (#117780)

The test case is currently expected to fail in the free-threaded build.
However, it fails before it gets a chance to close the write end of
the pipe.

files:
M Lib/test/test_capi/test_misc.py

diff --git a/Lib/test/test_capi/test_misc.py b/Lib/test/test_capi/test_misc.py
index 8cdecaf3626401..9c24ec8fd05b12 100644
--- a/Lib/test/test_capi/test_misc.py
+++ b/Lib/test/test_capi/test_misc.py
@@ -2139,6 +2139,9 @@ def check(enabled, override):
             }
 
             r, w = os.pipe()
+            if Py_GIL_DISABLED:
+                # gh-117649: The test fails before `w` is closed
+                self.addCleanup(os.close, w)
             script = textwrap.dedent(f'''
                 from test.test_capi.check_config import run_singlephase_check
                 run_singlephase_check({override}, {w})

_______________________________________________
Python-checkins mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3/lists/python-checkins.python.org/
Member address: [email protected]

Reply via email to