gh-100218: correctly set errno when socket.if_{nametoindex,indextoname} raise OSError#140905
Conversation
|
I used https://man.cx/if_nametoindex#heading5 for the default errors of each function. |
|
🤖 New build scheduled with the buildbot fleet by @picnixz for commit 551a199 🤖 Results will be shown at: https://buildbot.python.org/all/#/grid?branch=refs%2Fpull%2F140905%2Fmerge If you want to schedule another build, you need to add the 🔨 test-with-buildbots label again. |
|
All failures are urllib2net failures that already track: #140748. |
|
Thanks @picnixz for the PR 🌮🎉.. I'm working now to backport this PR to: 3.13, 3.14. |
…ndextoname}` raise `OSError` (pythonGH-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 3ce2d57) Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
|
GH-141284 is a backport of this pull request to the 3.14 branch. |
|
Sorry, @picnixz, I could not cleanly backport this to |
…index,indextoname}` raise `OSError` (pythonGH-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 3ce2d57) Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
|
GH-141285 is a backport of this pull request to the 3.13 branch. |
…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 3ce2d57) Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
…ndextoname}` raise `OSError` (python#140905) Previously, socket.if_nametoindex() and socket.if_indextoname() could raise an `OSError` with a `None` errno. Now, the errno from libc is propagated.
socket.if_nametoindex('no-such-iface')raisesOSError()without settingerrno#100218