Skip to content

Commit ef834de

Browse files
authored
gh-128546: Document that getaddrinfo() can return raw data (#128547)
Document that getaddrinfo() can return raw data This is the case for IPv6 addresses if Python was compiled with --disable-ipv6.
1 parent 79c03ac commit ef834de

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

Doc/library/socket.rst

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1072,10 +1072,16 @@ The :mod:`socket` module also offers various network-related services:
10721072
a string representing the canonical name of the *host* if
10731073
:const:`AI_CANONNAME` is part of the *flags* argument; else *canonname*
10741074
will be empty. *sockaddr* is a tuple describing a socket address, whose
1075-
format depends on the returned *family* (a ``(address, port)`` 2-tuple for
1076-
:const:`AF_INET`, a ``(address, port, flowinfo, scope_id)`` 4-tuple for
1077-
:const:`AF_INET6`), and is meant to be passed to the :meth:`socket.connect`
1078-
method.
1075+
format depends on the returned *family* and flags Python was compiled with,
1076+
and is meant to be passed to the :meth:`socket.connect` method.
1077+
1078+
*sockaddr* can be one of the following:
1079+
1080+
* a ``(address, port)`` 2-tuple for :const:`AF_INET`
1081+
* a ``(address, port, flowinfo, scope_id)`` 4-tuple for :const:`AF_INET6` if
1082+
Python was compiled with ``--enable-ipv6`` (the default)
1083+
* a 2-tuple containing raw data for :const:`AF_INET6` if Python was
1084+
compiled with ``--disable-ipv6``
10791085

10801086
.. note::
10811087

0 commit comments

Comments
 (0)