From: Robert Bradshaw Date: Fri, 22 Jan 2010 03:46:55 +0000 (-0800) Subject: Fix too many open files bug in testrunner. X-Git-Tag: 0.12.1~16 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=b5bcc8c426db101225e20885b25aa5a0c96ff52b;p=cython.git Fix too many open files bug in testrunner. It seems that temp file handles don't work well with fork. --- diff --git a/runtests.py b/runtests.py index 18ead284..9ac487f7 100644 --- a/runtests.py +++ b/runtests.py @@ -404,12 +404,12 @@ class CythonRunTestCase(CythonCompileTestCase): # fork to make sure we do not keep the tested module loaded result_handle, result_file = tempfile.mkstemp() + os.close(result_handle) child_id = os.fork() if not child_id: result_code = 0 try: try: - output = os.fdopen(result_handle, 'wb') tests = None try: partial_result = PartialTestResult(result) @@ -425,6 +425,7 @@ class CythonRunTestCase(CythonCompileTestCase): **{module_name: None}) partial_result.addError(tests, sys.exc_info()) result_code = 1 + output = open(result_file, 'wb') pickle.dump(partial_result.data(), output) except: import traceback