https://github.com/python/cpython/commit/ef834dee89d5b9413366db4cc519b015c51b5cb9
commit: ef834dee89d5b9413366db4cc519b015c51b5cb9
branch: main
author: Sebastian Rittau <[email protected]>
committer: hauntsaninja <[email protected]>
date: 2025-12-29T21:23:30-08:00
summary:

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.

files:
M Doc/library/socket.rst

diff --git a/Doc/library/socket.rst b/Doc/library/socket.rst
index 743d768bfa1f49..b7115942d1fdd1 100644
--- a/Doc/library/socket.rst
+++ b/Doc/library/socket.rst
@@ -1072,10 +1072,16 @@ The :mod:`socket` module also offers various 
network-related services:
    a string representing the canonical name of the *host* if
    :const:`AI_CANONNAME` is part of the *flags* argument; else *canonname*
    will be empty.  *sockaddr* is a tuple describing a socket address, whose
-   format depends on the returned *family* (a ``(address, port)`` 2-tuple for
-   :const:`AF_INET`, a ``(address, port, flowinfo, scope_id)`` 4-tuple for
-   :const:`AF_INET6`), and is meant to be passed to the :meth:`socket.connect`
-   method.
+   format depends on the returned *family* and flags Python was compiled with,
+   and is meant to be passed to the :meth:`socket.connect` method.
+
+   *sockaddr* can be one of the following:
+
+   * a ``(address, port)`` 2-tuple for :const:`AF_INET`
+   * a ``(address, port, flowinfo, scope_id)`` 4-tuple for :const:`AF_INET6` if
+     Python was compiled with ``--enable-ipv6`` (the default)
+   * a 2-tuple containing raw data for :const:`AF_INET6` if Python was
+     compiled with ``--disable-ipv6``
 
    .. note::
 

_______________________________________________
Python-checkins mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3//lists/python-checkins.python.org
Member address: [email protected]

Reply via email to