From: Eric Smith Date: Fri, 18 Sep 2009 13:23:13 +0000 (+0000) Subject: Issue #6882: Import uuid creates zombies processes. I used a slightly different patch... X-Git-Tag: v3.2a1~2536 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=81fd8040341a991b482bf3fecec454286274ef79;p=python Issue #6882: Import uuid creates zombies processes. I used a slightly different patch than the one attached to the issue, to be consistent with the style in the rest of the module. --- diff --git a/Lib/ctypes/util.py b/Lib/ctypes/util.py index 794b895aa0..1bd2d70fd3 100644 --- a/Lib/ctypes/util.py +++ b/Lib/ctypes/util.py @@ -219,8 +219,12 @@ elif os.name == "posix": # XXX assuming GLIBC's ldconfig (with option -p) expr = r'(\S+)\s+\((%s(?:, OS ABI:[^\)]*)?)\)[^/]*(/[^\(\)\s]*lib%s\.[^\(\)\s]*)' \ % (abi_type, re.escape(name)) - res = re.search(expr, - os.popen('/sbin/ldconfig -p 2>/dev/null').read()) + f = os.popen('/sbin/ldconfig -p 2>/dev/null') + try: + data = f.read() + finally: + f.close() + res = re.search(expr, data) if not res: return None return res.group(1) diff --git a/Misc/NEWS b/Misc/NEWS index 3466c358bb..ee97832db2 100644 --- a/Misc/NEWS +++ b/Misc/NEWS @@ -72,6 +72,8 @@ C-API Library ------- +- Issue #6882: Import uuid creates zombies processes. + - Issue #6635: Fix profiler printing usage message. - Issue #6856: Add a filter keyword argument to TarFile.add().