[issue42620] documentation on `getsockname()` wrong for AF_INET6

Christian Heimes report at bugs.python.org
Fri Dec 11 09:21:11 EST 2020


Christian Heimes <lists at cheimes.de> added the comment:

Good point. The address info depends on the address family, https://docs.python.org/3/library/socket.html#socket-families . I have updated the doc string:

>>> import socket
>>> print(socket.socket.getsockname.__doc__)
getsockname() -> address info

Return the address of the local endpoint. The format depends on the
address family. For IPv4 sockets, the address info is a pair
(hostaddr, port).

----------
versions: +Python 3.10, Python 3.8, Python 3.9 -Python 3.7

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue42620>
_______________________________________


More information about the Python-bugs-list mailing list