From d134813dcad7cdfb1eca4aeaeb78f7828c8604f1 Mon Sep 17 00:00:00 2001 From: Jakub Stasiak Date: Sun, 7 Jun 2020 15:20:37 +0200 Subject: [PATCH 1/3] bpo-40901: Describe what "interface name" means on Windows --- Doc/library/socket.rst | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/Doc/library/socket.rst b/Doc/library/socket.rst index d798c1a9d10a05..816e716908b336 100755 --- a/Doc/library/socket.rst +++ b/Doc/library/socket.rst @@ -1091,6 +1091,17 @@ The :mod:`socket` module also offers various network-related services: .. versionchanged:: 3.8 Windows support was added. + .. note:: + + On Windows network interfaces have different names in different contexts: + + * UUID: `{FB605B73-AAC2-49A6-9A2F-25416AEA0573}` + * name: `ethernet_32770` + * friendly name: `vEthernet (nat)` + * description: `Hyper-V Virtual Ethernet Adapter` + + This function returns names of the second form from the list. + .. function:: if_nametoindex(if_name) @@ -1105,6 +1116,9 @@ The :mod:`socket` module also offers various network-related services: .. versionchanged:: 3.8 Windows support was added. + .. seealso:: + "Interface name" is a name as documented in :func:`if_nameindex`. + .. function:: if_indextoname(if_index) @@ -1119,6 +1133,9 @@ The :mod:`socket` module also offers various network-related services: .. versionchanged:: 3.8 Windows support was added. + .. seealso:: + "Interface name" is a name as documented in :func:`if_nameindex`. + .. _socket-objects: From b26d41f79bfe7598124ce90ff7ded5e6e6f01bdd Mon Sep 17 00:00:00 2001 From: Jakub Stasiak Date: Sun, 7 Jun 2020 15:36:17 +0200 Subject: [PATCH 2/3] Fix the markup --- Doc/library/socket.rst | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Doc/library/socket.rst b/Doc/library/socket.rst index 816e716908b336..dcd76fba00c0aa 100755 --- a/Doc/library/socket.rst +++ b/Doc/library/socket.rst @@ -1095,10 +1095,10 @@ The :mod:`socket` module also offers various network-related services: On Windows network interfaces have different names in different contexts: - * UUID: `{FB605B73-AAC2-49A6-9A2F-25416AEA0573}` - * name: `ethernet_32770` - * friendly name: `vEthernet (nat)` - * description: `Hyper-V Virtual Ethernet Adapter` + * UUID: ``{FB605B73-AAC2-49A6-9A2F-25416AEA0573}`` + * name: ``ethernet_32770`` + * friendly name: ``vEthernet (nat)`` + * description: ``Hyper-V Virtual Ethernet Adapter`` This function returns names of the second form from the list. From 7bb50d3df96c95acd054fb65b256c2a92671b03d Mon Sep 17 00:00:00 2001 From: Jakub Stasiak Date: Sun, 4 Oct 2020 22:48:26 +0200 Subject: [PATCH 3/3] Try to be more explicit in the docs --- Doc/library/socket.rst | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Doc/library/socket.rst b/Doc/library/socket.rst index dcd76fba00c0aa..65e8540b65cd96 100755 --- a/Doc/library/socket.rst +++ b/Doc/library/socket.rst @@ -1093,14 +1093,16 @@ The :mod:`socket` module also offers various network-related services: .. note:: - On Windows network interfaces have different names in different contexts: + On Windows network interfaces have different names in different contexts + (all names are examples): * UUID: ``{FB605B73-AAC2-49A6-9A2F-25416AEA0573}`` * name: ``ethernet_32770`` * friendly name: ``vEthernet (nat)`` * description: ``Hyper-V Virtual Ethernet Adapter`` - This function returns names of the second form from the list. + This function returns names of the second form from the list, ``ethernet_32770`` + in this example case. .. function:: if_nametoindex(if_name)