]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
gh-93251: Decode localized socket error messages from the locale encoding (GH-154683)
authorSerhiy Storchaka <storchaka@gmail.com>
Sun, 26 Jul 2026 09:31:26 +0000 (12:31 +0300)
committerGitHub <noreply@github.com>
Sun, 26 Jul 2026 09:31:26 +0000 (12:31 +0300)
commit5afbb60e0283caaf34990bbe8437111ebaae04a4
tree80ed7b796f0c0d764920f43b15d999ea2c9fa478
parent306a35c71f1ceada3ea55479087d1c6a5cc8f15f
gh-93251: Decode localized socket error messages from the locale encoding (GH-154683)

The gai_strerror() and hstrerror() messages were decoded as UTF-8, so
gaierror and herror could be replaced with UnicodeDecodeError if the
message is localized and the locale encoding is not UTF-8.

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
Lib/test/test_socket.py
Misc/NEWS.d/next/Library/2026-07-25-13-30-00.gh-issue-93251.gAiErr.rst [new file with mode: 0644]
Modules/socketmodule.c