]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Try harder on issue #7356: ctypes.util: Make parsing of ldconfig output
authorMatthias Klose <doko@ubuntu.com>
Wed, 15 Sep 2010 13:06:09 +0000 (13:06 +0000)
committerMatthias Klose <doko@ubuntu.com>
Wed, 15 Sep 2010 13:06:09 +0000 (13:06 +0000)
independent of the locale. Set LC_ALL=C too.

Lib/ctypes/util.py

index 1cde0e3a8569e9d5a6fd683999bfba28536b7282..1881e89688800a14a6d94c413711694ba7bb31cd 100644 (file)
@@ -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: