]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
[3.13] gh-100218: correctly set `errno` when `socket.if_{nametoindex,indextoname...
authorBénédikt Tran <10796600+picnixz@users.noreply.github.com>
Sun, 9 Nov 2025 13:31:49 +0000 (14:31 +0100)
committerGitHub <noreply@github.com>
Sun, 9 Nov 2025 13:31:49 +0000 (13:31 +0000)
commit873f0d023cafe20876c2df2830ff31c226bb6280
tree40b04312dd6eeb7834d1fe8c80dbc55c97ac6fe4
parent052a53982a9b52ecd5401870b15aadcb3aa95b21
[3.13] gh-100218: correctly set `errno` when `socket.if_{nametoindex,indextoname}` raise `OSError` (GH-140905) (#141285)

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)
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