Skip to content

Commit f83689c

Browse files
miss-islingtonserhiy-storchakaclaude
authored
[3.14] gh-154551: Fix ctypes.util.find_library() in non-UTF-8 locales (GH-154552) (GH-154556)
_findLib_ld() failed to decode the localized "ld" stderr in the locale encoding. (cherry picked from commit 66e313f) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com> Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
1 parent a71a282 commit f83689c

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

Lib/ctypes/util.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -421,8 +421,7 @@ def _findLib_ld(name):
421421
result = None
422422
try:
423423
p = subprocess.Popen(cmd, stdout=subprocess.PIPE,
424-
stderr=subprocess.PIPE,
425-
universal_newlines=True)
424+
stderr=subprocess.PIPE)
426425
out, _ = p.communicate()
427426
res = re.findall(expr, os.fsdecode(out))
428427
for file in res:
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Fix :func:`ctypes.util.find_library` returning ``None`` in non-UTF-8 locales.

0 commit comments

Comments
 (0)