]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
[3.14] gh-154551: Fix ctypes.util.find_library() in non-UTF-8 locales (GH-154552...
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Fri, 24 Jul 2026 16:32:13 +0000 (18:32 +0200)
committerGitHub <noreply@github.com>
Fri, 24 Jul 2026 16:32:13 +0000 (19:32 +0300)
_findLib_ld() failed to decode the localized "ld" stderr in the locale
encoding.
(cherry picked from commit 66e313f471516bfa04c5c8966c159fafe6be082e)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
Lib/ctypes/util.py
Misc/NEWS.d/next/Library/2026-07-23-19-45-00.gh-issue-154551.Ct7pL9.rst [new file with mode: 0644]

index 3b21658433b2edb78336e7479ddce704db630718..29a9eaa14d9a4c048b9e655e1de9f08c0c700c0f 100644 (file)
@@ -421,8 +421,7 @@ elif os.name == "posix":
             result = None
             try:
                 p = subprocess.Popen(cmd, stdout=subprocess.PIPE,
-                                     stderr=subprocess.PIPE,
-                                     universal_newlines=True)
+                                     stderr=subprocess.PIPE)
                 out, _ = p.communicate()
                 res = re.findall(expr, os.fsdecode(out))
                 for file in res:
diff --git a/Misc/NEWS.d/next/Library/2026-07-23-19-45-00.gh-issue-154551.Ct7pL9.rst b/Misc/NEWS.d/next/Library/2026-07-23-19-45-00.gh-issue-154551.Ct7pL9.rst
new file mode 100644 (file)
index 0000000..c4db19d
--- /dev/null
@@ -0,0 +1 @@
+Fix :func:`ctypes.util.find_library` returning ``None`` in non-UTF-8 locales.