Skip to content

bpo-37007: Implement socket.if_nametoindex() and socket.if_indextoname() on Windows#13522

Merged
zooba merged 5 commits into
python:masterfrom
ZackerySpytz:bpo-37007-socket-if_nametoindex-win
May 29, 2019
Merged

bpo-37007: Implement socket.if_nametoindex() and socket.if_indextoname() on Windows#13522
zooba merged 5 commits into
python:masterfrom
ZackerySpytz:bpo-37007-socket-if_nametoindex-win

Conversation

@ZackerySpytz
Copy link
Copy Markdown
Contributor

@ZackerySpytz ZackerySpytz commented May 23, 2019

@ZackerySpytz ZackerySpytz requested a review from a team as a code owner May 23, 2019 10:23
@ZackerySpytz ZackerySpytz changed the title Implement socket.if_nametoindex() and socket.if_indextoname() on Windows bpo-37007: Implement socket.if_nametoindex() and socket.if_indextoname() on Windows May 23, 2019
Copy link
Copy Markdown
Member

@zooba zooba left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved, but I asked on bpo whether it's worth doing if_nameindex as well.

testInterfaceNameIndex() in test_socket.py is now run on Windows
(as hasattr(socket, 'if_nameindex') is now True).
Two other tests that aren't directly related to if_nameindex() have
been disabled on Windows. These tests only use if_nameindex() for the
purpose of picking a random network interface.
@ZackerySpytz
Copy link
Copy Markdown
Contributor Author

socket.if_nameindex() is now implemented on Windows.

testInterfaceNameIndex() in test_socket.py is now run on Windows (as hasattr(socket, 'if_nameindex') is now True). Two other tests that aren't directly related to if_nameindex() have been disabled on Windows. These tests only use if_nameindex() for the purpose of picking a random network interface.

Comment thread Modules/socketmodule.c Outdated
Comment thread Modules/socketmodule.c Outdated
Comment thread Modules/socketmodule.c Outdated
@ZackerySpytz
Copy link
Copy Markdown
Contributor Author

Hi, @zooba. Thanks for the review. I've updated the PR.

Copy link
Copy Markdown
Member

@zooba zooba left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a suggested comment to avoid me having to look up the APIs again next time I read this :)

Comment thread Modules/socketmodule.c
Comment thread Modules/socketmodule.c
Co-Authored-By: Steve Dower <steve.dower@microsoft.com>
@zooba zooba merged commit 8f96c9f into python:master May 29, 2019
@zooba
Copy link
Copy Markdown
Member

zooba commented May 29, 2019

Thanks @ZackerySpytz!

DinoV pushed a commit to DinoV/cpython that referenced this pull request Jan 14, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants