Skip to content

gh-128546: Document that getaddrinfo() can return raw data #128547

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 10 additions & 4 deletions Doc/library/socket.rst
Original file line number Diff line number Diff line change
Expand Up @@ -995,15 +995,21 @@

``(family, type, proto, canonname, sockaddr)``

In these tuples, *family*, *type*, *proto* are all integers and are

Check warning on line 998 in Doc/library/socket.rst

View workflow job for this annotation

GitHub Actions / Docs / Docs

py:const reference target not found: AI_CANONNAME [ref.const]
meant to be passed to the :func:`~socket.socket` function. *canonname* will be
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::

Expand Down
Loading