From cf1dd711a42d6ba0c7bf5a337eb8b26514c0e5f1 Mon Sep 17 00:00:00 2001 From: Matthias Klose Date: Wed, 15 Sep 2010 13:06:09 +0000 Subject: Try harder on issue #7356: ctypes.util: Make parsing of ldconfig output independent of the locale. Set LC_ALL=C too. --- Lib/ctypes/util.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Lib/ctypes/util.py b/Lib/ctypes/util.py index 1cde0e3..1881e89 100644 --- a/Lib/ctypes/util.py +++ b/Lib/ctypes/util.py @@ -205,7 +205,7 @@ 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)) - with contextlib.closing(os.popen('LANG=C /sbin/ldconfig -p 2>/dev/null')) as f: + with contextlib.closing(os.popen('LC_ALL=C LANG=C /sbin/ldconfig -p 2>/dev/null')) as f: data = f.read() res = re.search(expr, data) if not res: -- cgit v0.12