Skip to content

Commit 0e389ae

Browse files
committed
gh-115426: Fix the socket object close() cross-references
The three :meth:`socket.close` references in the socket object section resolved to the module-level socket.close(fd) function instead of the socket object's close() method. close is the only name that is both a module-level function and a socket method, so the Python domain matched <module>.<target> first; every other method reference on the page resolves correctly. Qualifying the target as socket.socket.close, as the neighbouring ioctl and shutdown references already do, points them at the method.
1 parent 77dd973 commit 0e389ae

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

Doc/library/socket.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1497,7 +1497,7 @@ Socket Objects
14971497
of :meth:`socket.getpeername` but not the actual OS resource. Unlike
14981498
:func:`socket.fromfd`, *fileno* will return the same socket and not a
14991499
duplicate. This may help close a detached socket using
1500-
:meth:`socket.close`.
1500+
:meth:`~socket.socket.close`.
15011501

15021502
The newly created socket is :ref:`non-inheritable <fd_inheritance>`.
15031503

@@ -1544,7 +1544,7 @@ Socket Objects
15441544

15451545
.. versionchanged:: 3.2
15461546
Support for the :term:`context manager` protocol was added. Exiting the
1547-
context manager is equivalent to calling :meth:`~socket.close`.
1547+
context manager is equivalent to calling :meth:`~socket.socket.close`.
15481548

15491549

15501550
.. method:: accept()
@@ -1769,7 +1769,7 @@ Socket Objects
17691769

17701770
Closing the file object returned by :meth:`makefile` won't close the
17711771
original socket unless all other file objects have been closed and
1772-
:meth:`socket.close` has been called on the socket object.
1772+
:meth:`~socket.socket.close` has been called on the socket object.
17731773

17741774
.. note::
17751775

0 commit comments

Comments
 (0)