]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-136003: Close file descriptors in test (GH-139225)
authorPetr Viktorin <encukou@gmail.com>
Mon, 22 Sep 2025 11:22:27 +0000 (13:22 +0200)
committerGitHub <noreply@github.com>
Mon, 22 Sep 2025 11:22:27 +0000 (13:22 +0200)
This fixes file descriptor leaks introduced in GH-136004

Lib/test/test_capi/test_misc.py

index fe1287167d3e7416edf6e05d5d6c1f4d8fb256ba..229a7c2afa8f8dd9d2938d7c083cec75bb83537c 100644 (file)
@@ -1996,6 +1996,7 @@ class SubinterpreterTest(unittest.TestCase):
         def output():
             time.sleep(1)
             os.write({w}, b"x")
+            os.close({w})
 
 
         def callback():
@@ -2014,6 +2015,7 @@ class SubinterpreterTest(unittest.TestCase):
         interp.close()
         data = os.read(r, 1)
         self.assertEqual(data, b"x")
+        os.close(r)
 
 
 @requires_subinterpreters