Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork33.4k
gh-100218: correctly seterrno whensocket.if_{nametoindex,indextoname} raiseOSError#140905
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
gh-100218: correctly seterrno whensocket.if_{nametoindex,indextoname} raiseOSError#140905
Uh oh!
There was an error while loading.Please reload this page.
Conversation
picnixz commentedNov 2, 2025
I usedhttps://man.cx/if_nametoindex#heading5 for the default errors of each function. |
bedevere-bot commentedNov 2, 2025
🤖 New build scheduled with the buildbot fleet by@picnixz for commit551a199 🤖 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. |
picnixz commentedNov 7, 2025
All failures are urllib2net failures that already track:#140748. |
vstinner left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
LGTM
3ce2d57 intopython:mainUh oh!
There was an error while loading.Please reload this page.
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 raisean `OSError` with a `None` errno. Now, the errno from libc is propagated.(cherry picked from commit3ce2d57)Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
GH-141284 is a backport of this pull request to the3.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 raisean `OSError` with a `None` errno. Now, the errno from libc is propagated.(cherry picked from commit3ce2d57)Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
GH-141285 is a backport of this pull request to the3.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 raisean `OSError` with a `None` errno. Now, the errno from libc is propagated.(cherry picked from commit3ce2d57)Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
Uh oh!
There was an error while loading.Please reload this page.
socket.if_nametoindex('no-such-iface')raisesOSError()without settingerrno#100218