From: Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> Date: Sun, 30 Mar 2025 08:28:26 +0000 (+0200) Subject: [3.12] gh-129994: update docs when using `dualstack_ipv6` in `socket.create_server... X-Git-Tag: v3.12.10~47 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=f1b65d757d3d19d014635a3606cd84c770d3bc33;p=thirdparty%2FPython%2Fcpython.git [3.12] gh-129994: update docs when using `dualstack_ipv6` in `socket.create_server` (GH-129996) (#131891) gh-129994: update docs when using `dualstack_ipv6` in `socket.create_server` (GH-129996) (cherry picked from commit 044a1e13d5cfc91b0a8774e936877e91cbac3a16) Co-authored-by: Alexander Ershov <150328014+AEErshov@users.noreply.github.com> --- diff --git a/Doc/library/socket.rst b/Doc/library/socket.rst index c0b88b8546df..d29e3c20e102 100644 --- a/Doc/library/socket.rst +++ b/Doc/library/socket.rst @@ -833,10 +833,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 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.