]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
[3.14] gh-100218: correctly set `errno` when `socket.if_{nametoindex,indextoname...
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Sun, 9 Nov 2025 13:11:43 +0000 (14:11 +0100)
committerGitHub <noreply@github.com>
Sun, 9 Nov 2025 13:11:43 +0000 (13:11 +0000)
commitd6b4f4b10fd70f62ee22f158f1ddbca00d5fe607
treef5632e7982b389da019fe594571f29aea04a7af4
parent432432bfc8a2a2cc99d8037fb6a83c977d9eb663
[3.14] gh-100218: correctly set `errno` when `socket.if_{nametoindex,indextoname}` raise `OSError` (GH-140905) (#141284)

gh-100218: correctly set `errno` when `socket.if_{nametoindex,indextoname}` raise `OSError` (GH-140905)

Previously, socket.if_nametoindex() and socket.if_indextoname() could raise
an `OSError` with a `None` errno. Now, the errno from libc is propagated.
(cherry picked from commit 3ce2d57b2f02030353af314d89c5f6215d2f5c96)

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
Lib/test/test_socket.py
Misc/NEWS.d/next/Library/2025-11-02-11-46-00.gh-issue-100218.9Ezfdq.rst [new file with mode: 0644]
Modules/socketmodule.c