https://github.com/python/cpython/commit/71361f331b30a34eb99e9c54ed37f96004fa9ea5 commit: 71361f331b30a34eb99e9c54ed37f96004fa9ea5 branch: 3.15 author: Miss Islington (bot) <[email protected]> committer: serhiy-storchaka <[email protected]> date: 2026-07-24T19:31:56+03:00 summary:
[3.15] gh-154551: Fix ctypes.util.find_library() in non-UTF-8 locales (GH-154552) (GH-154555) _findLib_ld() failed to decode the localized "ld" stderr in the locale encoding. (cherry picked from commit 66e313f471516bfa04c5c8966c159fafe6be082e) Co-authored-by: Serhiy Storchaka <[email protected]> Co-authored-by: Claude Opus 4.8 <[email protected]> files: A Misc/NEWS.d/next/Library/2026-07-23-19-45-00.gh-issue-154551.Ct7pL9.rst M Lib/ctypes/util.py diff --git a/Lib/ctypes/util.py b/Lib/ctypes/util.py index 35ac5b6bfd6a37f..93dceb3d586b06d 100644 --- a/Lib/ctypes/util.py +++ b/Lib/ctypes/util.py @@ -422,8 +422,7 @@ def _findLib_ld(name): 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 index 000000000000000..c4db19d89364e07 --- /dev/null +++ b/Misc/NEWS.d/next/Library/2026-07-23-19-45-00.gh-issue-154551.Ct7pL9.rst @@ -0,0 +1 @@ +Fix :func:`ctypes.util.find_library` returning ``None`` in non-UTF-8 locales. _______________________________________________ Python-checkins mailing list -- [email protected] To unsubscribe send an email to [email protected] https://mail.python.org/mailman3//lists/python-checkins.python.org Member address: [email protected]
