Index: Lib/test/test_threading.py =================================================================== --- Lib/test/test_threading.py (revision 86050) +++ Lib/test/test_threading.py (working copy) @@ -448,6 +448,7 @@ self.assertEqual(data, "end of main\nend of thread\n") self.assertFalse(rc == 2, "interpreter was blocked") self.assertTrue(rc == 0, "Unexpected error") + p.stdout.close() def test_1_join_on_shutdown(self): # The usual case: on exit, wait for a non-daemon thread