From 1a1087f86f2c58a1e9895c95b58befc030d14e28 Mon Sep 17 00:00:00 2001 From: Alexander Ershov Date: Tue, 11 Feb 2025 17:30:19 +0700 Subject: [PATCH 1/2] Add docs to socket.create_server Family should be AF_INET when dualstack_ipv6 is True. --- Doc/library/socket.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Doc/library/socket.rst b/Doc/library/socket.rst index b936a502ca886e..888fddf754a1de 100644 --- a/Doc/library/socket.rst +++ b/Doc/library/socket.rst @@ -854,7 +854,7 @@ The following functions all create :ref:`socket objects `. , a default reasonable value is chosen. *reuse_port* dictates whether to set the :data:`SO_REUSEPORT` socket option. - If *dualstack_ipv6* is true and the platform supports it the socket will + If *dualstack_ipv6* is true, *family* is :data:`AF_INET6` and the platform supports it the socket will be able to accept both IPv4 and IPv6 connections, else it will raise :exc:`ValueError`. Most POSIX platforms and Windows are supposed to support this functionality. From ee8aa065e4dc79e6d49eec27f5220c86d33f6437 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?B=C3=A9n=C3=A9dikt=20Tran?= <10796600+picnixz@users.noreply.github.com> Date: Sun, 30 Mar 2025 10:13:58 +0200 Subject: [PATCH 2/2] wrap lines under 80 chars --- 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 1f6a9458d63df0..1bc7f76b5ba694 100644 --- a/Doc/library/socket.rst +++ b/Doc/library/socket.rst @@ -882,10 +882,10 @@ The following functions all create :ref:`socket objects `. , a default reasonable value is chosen. *reuse_port* dictates whether to set the :data:`SO_REUSEPORT` socket option. - If *dualstack_ipv6* is true, *family* is :data:`AF_INET6` and the platform supports it the socket will - be able to accept both IPv4 and IPv6 connections, else it will raise - :exc:`ValueError`. Most POSIX platforms and Windows are supposed to support - this functionality. + If *dualstack_ipv6* is true, *family* is :data:`AF_INET6` and the platform + supports it the socket will be able to accept both IPv4 and IPv6 connections, + else it will raise :exc:`ValueError`. Most POSIX platforms and Windows are + supposed to support this functionality. When this functionality is enabled the address returned by :meth:`socket.getpeername` when an IPv4 connection occurs will be an IPv6 address represented as an IPv4-mapped IPv6 address.