From: Matthias Klose Date: Wed, 15 Sep 2010 13:06:09 +0000 (+0000) Subject: Try harder on issue #7356: ctypes.util: Make parsing of ldconfig output X-Git-Tag: v3.2a3~252 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=cf1dd711a42d6ba0c7bf5a337eb8b26514c0e5f1;p=thirdparty%2FPython%2Fcpython.git Try harder on issue #7356: ctypes.util: Make parsing of ldconfig output independent of the locale. Set LC_ALL=C too. --- diff --git a/Lib/ctypes/util.py b/Lib/ctypes/util.py index 1cde0e3a8569..1881e8968880 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: