Skip to content

gh-154551: Fix ctypes.util.find_library() in non-UTF-8 locales#154552

Merged
serhiy-storchaka merged 1 commit into
python:mainfrom
serhiy-storchaka:ctypes-findlib-ld-locale
Jul 23, 2026
Merged

gh-154551: Fix ctypes.util.find_library() in non-UTF-8 locales#154552
serhiy-storchaka merged 1 commit into
python:mainfrom
serhiy-storchaka:ctypes-findlib-ld-locale

Conversation

@serhiy-storchaka

Copy link
Copy Markdown
Member

_findLib_ld() ran ld with universal_newlines=True, so communicate() decoded its output in the locale encoding and failed on a localized diagnostic on stderr. The exception was swallowed, so find_library() returned None. The stderr is discarded and the stdout is already decoded with os.fsdecode(), so the output is now read as bytes.

_findLib_ld() failed to decode the localized "ld" stderr in the locale
encoding.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@serhiy-storchaka serhiy-storchaka added needs backport to 3.13 bugs and security fixes needs backport to 3.14 bugs and security fixes needs backport to 3.15 pre-release feature fixes, bugs and security fixes labels Jul 23, 2026
@serhiy-storchaka
serhiy-storchaka enabled auto-merge (squash) July 23, 2026 17:18
@serhiy-storchaka
serhiy-storchaka merged commit 66e313f into python:main Jul 23, 2026
58 checks passed
@miss-islington-app

Copy link
Copy Markdown

Thanks @serhiy-storchaka for the PR 🌮🎉.. I'm working now to backport this PR to: 3.13, 3.14, 3.15.
🐍🍒⛏🤖

@bedevere-app

bedevere-app Bot commented Jul 23, 2026

Copy link
Copy Markdown

GH-154555 is a backport of this pull request to the 3.15 branch.

@bedevere-app bedevere-app Bot removed the needs backport to 3.15 pre-release feature fixes, bugs and security fixes label Jul 23, 2026
@bedevere-app

bedevere-app Bot commented Jul 23, 2026

Copy link
Copy Markdown

GH-154556 is a backport of this pull request to the 3.14 branch.

@bedevere-app bedevere-app Bot removed the needs backport to 3.14 bugs and security fixes label Jul 23, 2026
@bedevere-app

bedevere-app Bot commented Jul 23, 2026

Copy link
Copy Markdown

GH-154557 is a backport of this pull request to the 3.13 branch.

@bedevere-app bedevere-app Bot removed the needs backport to 3.13 bugs and security fixes label Jul 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant