https://github.com/python/cpython/commit/61e54e52ea48b6716d705294a18c6ac22d90741f
commit: 61e54e52ea48b6716d705294a18c6ac22d90741f
branch: main
author: Petr Viktorin <[email protected]>
committer: encukou <[email protected]>
date: 2025-09-22T13:22:27+02:00
summary:

gh-136003: Close file descriptors in test (GH-139225)

This fixes file descriptor leaks introduced in GH-136004

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 fe1287167d3e74..229a7c2afa8f8d 100644
--- a/Lib/test/test_capi/test_misc.py
+++ b/Lib/test/test_capi/test_misc.py
@@ -1996,6 +1996,7 @@ def test_pending_call_creates_thread_subinterpreter(self):
         def output():
             time.sleep(1)
             os.write({w}, b"x")
+            os.close({w})
 
 
         def callback():
@@ -2014,6 +2015,7 @@ def create_pending_call():
         interp.close()
         data = os.read(r, 1)
         self.assertEqual(data, b"x")
+        os.close(r)
 
 
 @requires_subinterpreters

_______________________________________________
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