Skip to content

Commit 756062b

Browse files
authored
gh-101100: Fix sphinx warnings in library/socketserver.rst (GH-110207)
1 parent 7f702b2 commit 756062b

File tree

2 files changed

+52
-26
lines changed

2 files changed

+52
-26
lines changed

Doc/library/socketserver.rst

+52-25
Original file line numberDiff line numberDiff line change
@@ -116,23 +116,28 @@ server is the address family.
116116
:class:`ForkingMixIn` and the Forking classes mentioned below are
117117
only available on POSIX platforms that support :func:`~os.fork`.
118118

119-
:meth:`socketserver.ForkingMixIn.server_close` waits until all child
120-
processes complete, except if
121-
:attr:`socketserver.ForkingMixIn.block_on_close` attribute is false.
119+
.. attribute:: block_on_close
122120

123-
:meth:`socketserver.ThreadingMixIn.server_close` waits until all non-daemon
124-
threads complete, except if
125-
:attr:`socketserver.ThreadingMixIn.block_on_close` attribute is false. Use
126-
daemonic threads by setting
127-
:data:`ThreadingMixIn.daemon_threads` to ``True`` to not wait until threads
128-
complete.
121+
:meth:`ForkingMixIn.server_close <BaseServer.server_close>`
122+
waits until all child processes complete, except if
123+
:attr:`block_on_close` attribute is ``False``.
124+
125+
:meth:`ThreadingMixIn.server_close <BaseServer.server_close>`
126+
waits until all non-daemon threads complete, except if
127+
:attr:`block_on_close` attribute is ``False``.
128+
129+
.. attribute:: daemon_threads
130+
131+
For :class:`ThreadingMixIn` use daemonic threads by setting
132+
:data:`ThreadingMixIn.daemon_threads <daemon_threads>`
133+
to ``True`` to not wait until threads complete.
129134

130135
.. versionchanged:: 3.7
131136

132-
:meth:`socketserver.ForkingMixIn.server_close` and
133-
:meth:`socketserver.ThreadingMixIn.server_close` now waits until all
137+
:meth:`ForkingMixIn.server_close <BaseServer.server_close>` and
138+
:meth:`ThreadingMixIn.server_close <BaseServer.server_close>` now waits until all
134139
child processes and non-daemonic threads complete.
135-
Add a new :attr:`socketserver.ForkingMixIn.block_on_close` class
140+
Add a new :attr:`ForkingMixIn.block_on_close <block_on_close>` class
136141
attribute to opt-in for the pre-3.7 behaviour.
137142

138143

@@ -412,13 +417,13 @@ Request Handler Objects
412417

413418
This function must do all the work required to service a request. The
414419
default implementation does nothing. Several instance attributes are
415-
available to it; the request is available as :attr:`self.request`; the client
416-
address as :attr:`self.client_address`; and the server instance as
417-
:attr:`self.server`, in case it needs access to per-server information.
420+
available to it; the request is available as :attr:`request`; the client
421+
address as :attr:`client_address`; and the server instance as
422+
:attr:`server`, in case it needs access to per-server information.
418423

419-
The type of :attr:`self.request` is different for datagram or stream
420-
services. For stream services, :attr:`self.request` is a socket object; for
421-
datagram services, :attr:`self.request` is a pair of string and socket.
424+
The type of :attr:`request` is different for datagram or stream
425+
services. For stream services, :attr:`request` is a socket object; for
426+
datagram services, :attr:`request` is a pair of string and socket.
422427

423428

424429
.. method:: finish()
@@ -428,20 +433,42 @@ Request Handler Objects
428433
raises an exception, this function will not be called.
429434

430435

436+
.. attribute:: request
437+
438+
The *new* :class:`socket.socket` object
439+
to be used to communicate with the client.
440+
441+
442+
.. attribute:: client_address
443+
444+
Client address returned by :meth:`BaseServer.get_request`.
445+
446+
447+
.. attribute:: server
448+
449+
:class:`BaseServer` object used for handling the request.
450+
451+
431452
.. class:: StreamRequestHandler
432453
DatagramRequestHandler
433454

434455
These :class:`BaseRequestHandler` subclasses override the
435456
:meth:`~BaseRequestHandler.setup` and :meth:`~BaseRequestHandler.finish`
436-
methods, and provide :attr:`self.rfile` and :attr:`self.wfile` attributes.
437-
The :attr:`self.rfile` and :attr:`self.wfile` attributes can be
438-
read or written, respectively, to get the request data or return data
439-
to the client.
440-
The :attr:`!rfile` attributes support the :class:`io.BufferedIOBase` readable interface,
441-
and :attr:`!wfile` attributes support the :class:`!io.BufferedIOBase` writable interface.
457+
methods, and provide :attr:`rfile` and :attr:`wfile` attributes.
458+
459+
.. attribute:: rfile
460+
461+
A file object from which receives the request is read.
462+
Support the :class:`io.BufferedIOBase` readable interface.
463+
464+
.. attribute:: wfile
465+
466+
A file object to which the reply is written.
467+
Support the :class:`io.BufferedIOBase` writable interface
468+
442469

443470
.. versionchanged:: 3.6
444-
:attr:`StreamRequestHandler.wfile` also supports the
471+
:attr:`wfile` also supports the
445472
:class:`io.BufferedIOBase` writable interface.
446473

447474

Doc/tools/.nitignore

-1
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,6 @@ Doc/library/shelve.rst
108108
Doc/library/signal.rst
109109
Doc/library/smtplib.rst
110110
Doc/library/socket.rst
111-
Doc/library/socketserver.rst
112111
Doc/library/ssl.rst
113112
Doc/library/stdtypes.rst
114113
Doc/library/string.rst

0 commit comments

Comments
 (0)