From: Antoine Pitrou Date: Thu, 1 Aug 2013 22:08:51 +0000 (+0200) Subject: Fix the RLIMIT_CORE resource lowering logic in test_subprocess. X-Git-Tag: v3.4.0a1~18 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=284e5ce67ec0ffcc3feb5d8526727fa3a8c35f7a;p=python Fix the RLIMIT_CORE resource lowering logic in test_subprocess. We must only lower the soft limit, since lowering the hard limit makes it impossible to raise it back at the end. (this could prevent core dumps from being generated when the test suite crashes) --- diff --git a/Lib/test/test_subprocess.py b/Lib/test/test_subprocess.py index 7899aebe06..3bbb19c573 100644 --- a/Lib/test/test_subprocess.py +++ b/Lib/test/test_subprocess.py @@ -1123,7 +1123,7 @@ class _SuppressCoreFiles(object): if resource is not None: try: self.old_limit = resource.getrlimit(resource.RLIMIT_CORE) - resource.setrlimit(resource.RLIMIT_CORE, (0, 0)) + resource.setrlimit(resource.RLIMIT_CORE, (0, self.old_limit[1])) except (ValueError, resource.error): pass