Skip to content

Commit 02349e2

Browse files
[3.8] [doc] Fix erroneous backslashes in signatures and names (GH-23658) (GH-23828)
The issue being resolved is shown in the 3.10 docs (if you select docs for older versions you won't see a visual glitch). The newer sphinx version that produces the 3.10 docs doesn't treat the backslash to escape things in some situations it previously did.. (cherry picked from commit dcc997c) Co-authored-by: Andre Delfino <[email protected]>
1 parent d3ab4c8 commit 02349e2

30 files changed

+84
-84
lines changed

Doc/library/asyncio-eventloop.rst

+18-18
Original file line numberDiff line numberDiff line change
@@ -309,7 +309,7 @@ Creating Futures and Tasks
309309

310310
.. versionadded:: 3.5.2
311311

312-
.. method:: loop.create_task(coro, \*, name=None)
312+
.. method:: loop.create_task(coro, *, name=None)
313313

314314
Schedule the execution of a :ref:`coroutine`.
315315
Return a :class:`Task` object.
@@ -344,7 +344,7 @@ Opening network connections
344344
^^^^^^^^^^^^^^^^^^^^^^^^^^^
345345

346346
.. coroutinemethod:: loop.create_connection(protocol_factory, \
347-
host=None, port=None, \*, ssl=None, \
347+
host=None, port=None, *, ssl=None, \
348348
family=0, proto=0, flags=0, sock=None, \
349349
local_addr=None, server_hostname=None, \
350350
ssl_handshake_timeout=None, \
@@ -470,7 +470,7 @@ Opening network connections
470470
that can be used directly in async/await code.
471471

472472
.. coroutinemethod:: loop.create_datagram_endpoint(protocol_factory, \
473-
local_addr=None, remote_addr=None, \*, \
473+
local_addr=None, remote_addr=None, *, \
474474
family=0, proto=0, flags=0, \
475475
reuse_address=None, reuse_port=None, \
476476
allow_broadcast=None, sock=None)
@@ -547,7 +547,7 @@ Opening network connections
547547
Added support for Windows.
548548

549549
.. coroutinemethod:: loop.create_unix_connection(protocol_factory, \
550-
path=None, \*, ssl=None, sock=None, \
550+
path=None, *, ssl=None, sock=None, \
551551
server_hostname=None, ssl_handshake_timeout=None)
552552
553553
Create a Unix connection.
@@ -580,7 +580,7 @@ Creating network servers
580580
^^^^^^^^^^^^^^^^^^^^^^^^
581581

582582
.. coroutinemethod:: loop.create_server(protocol_factory, \
583-
host=None, port=None, \*, \
583+
host=None, port=None, *, \
584584
family=socket.AF_UNSPEC, \
585585
flags=socket.AI_PASSIVE, \
586586
sock=None, backlog=100, ssl=None, \
@@ -671,7 +671,7 @@ Creating network servers
671671

672672

673673
.. coroutinemethod:: loop.create_unix_server(protocol_factory, path=None, \
674-
\*, sock=None, backlog=100, ssl=None, \
674+
*, sock=None, backlog=100, ssl=None, \
675675
ssl_handshake_timeout=None, start_serving=True)
676676
677677
Similar to :meth:`loop.create_server` but works with the
@@ -696,7 +696,7 @@ Creating network servers
696696
The *path* parameter can now be a :class:`~pathlib.Path` object.
697697

698698
.. coroutinemethod:: loop.connect_accepted_socket(protocol_factory, \
699-
sock, \*, ssl=None, ssl_handshake_timeout=None)
699+
sock, *, ssl=None, ssl_handshake_timeout=None)
700700
701701
Wrap an already accepted connection into a transport/protocol pair.
702702

@@ -761,7 +761,7 @@ TLS Upgrade
761761
^^^^^^^^^^^
762762

763763
.. coroutinemethod:: loop.start_tls(transport, protocol, \
764-
sslcontext, \*, server_side=False, \
764+
sslcontext, *, server_side=False, \
765765
server_hostname=None, ssl_handshake_timeout=None)
766766
767767
Upgrade an existing transport-based connection to TLS.
@@ -794,7 +794,7 @@ TLS Upgrade
794794
Watching file descriptors
795795
^^^^^^^^^^^^^^^^^^^^^^^^^
796796

797-
.. method:: loop.add_reader(fd, callback, \*args)
797+
.. method:: loop.add_reader(fd, callback, *args)
798798

799799
Start monitoring the *fd* file descriptor for read availability and
800800
invoke *callback* with the specified arguments once *fd* is available for
@@ -804,7 +804,7 @@ Watching file descriptors
804804

805805
Stop monitoring the *fd* file descriptor for read availability.
806806

807-
.. method:: loop.add_writer(fd, callback, \*args)
807+
.. method:: loop.add_writer(fd, callback, *args)
808808

809809
Start monitoring the *fd* file descriptor for write availability and
810810
invoke *callback* with the specified arguments once *fd* is available for
@@ -918,7 +918,7 @@ convenient.
918918
:meth:`loop.create_server` and :func:`start_server`.
919919

920920
.. coroutinemethod:: loop.sock_sendfile(sock, file, offset=0, count=None, \
921-
\*, fallback=True)
921+
*, fallback=True)
922922
923923
Send a file using high-performance :mod:`os.sendfile` if possible.
924924
Return the total number of bytes sent.
@@ -952,7 +952,7 @@ convenient.
952952
DNS
953953
^^^
954954

955-
.. coroutinemethod:: loop.getaddrinfo(host, port, \*, family=0, \
955+
.. coroutinemethod:: loop.getaddrinfo(host, port, *, family=0, \
956956
type=0, proto=0, flags=0)
957957

958958
Asynchronous version of :meth:`socket.getaddrinfo`.
@@ -1017,7 +1017,7 @@ Working with pipes
10171017
Unix signals
10181018
^^^^^^^^^^^^
10191019

1020-
.. method:: loop.add_signal_handler(signum, callback, \*args)
1020+
.. method:: loop.add_signal_handler(signum, callback, *args)
10211021

10221022
Set *callback* as the handler for the *signum* signal.
10231023

@@ -1052,7 +1052,7 @@ Unix signals
10521052
Executing code in thread or process pools
10531053
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
10541054

1055-
.. awaitablemethod:: loop.run_in_executor(executor, func, \*args)
1055+
.. awaitablemethod:: loop.run_in_executor(executor, func, *args)
10561056

10571057
Arrange for *func* to be called in the specified executor.
10581058

@@ -1222,9 +1222,9 @@ async/await code consider using the high-level
12221222
subprocesses. See :ref:`Subprocess Support on Windows
12231223
<asyncio-windows-subprocess>` for details.
12241224

1225-
.. coroutinemethod:: loop.subprocess_exec(protocol_factory, \*args, \
1225+
.. coroutinemethod:: loop.subprocess_exec(protocol_factory, *args, \
12261226
stdin=subprocess.PIPE, stdout=subprocess.PIPE, \
1227-
stderr=subprocess.PIPE, \*\*kwargs)
1227+
stderr=subprocess.PIPE, **kwargs)
12281228
12291229
Create a subprocess from one or more string arguments specified by
12301230
*args*.
@@ -1304,9 +1304,9 @@ async/await code consider using the high-level
13041304
conforms to the :class:`asyncio.SubprocessTransport` base class and
13051305
*protocol* is an object instantiated by the *protocol_factory*.
13061306

1307-
.. coroutinemethod:: loop.subprocess_shell(protocol_factory, cmd, \*, \
1307+
.. coroutinemethod:: loop.subprocess_shell(protocol_factory, cmd, *, \
13081308
stdin=subprocess.PIPE, stdout=subprocess.PIPE, \
1309-
stderr=subprocess.PIPE, \*\*kwargs)
1309+
stderr=subprocess.PIPE, **kwargs)
13101310
13111311
Create a subprocess from *cmd*, which can be a :class:`str` or a
13121312
:class:`bytes` string encoded to the

Doc/library/asyncio-future.rst

+3-3
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ Future Functions
3131
.. versionadded:: 3.5
3232

3333

34-
.. function:: ensure_future(obj, \*, loop=None)
34+
.. function:: ensure_future(obj, *, loop=None)
3535

3636
Return:
3737

@@ -58,7 +58,7 @@ Future Functions
5858
The function accepts any :term:`awaitable` object.
5959

6060

61-
.. function:: wrap_future(future, \*, loop=None)
61+
.. function:: wrap_future(future, *, loop=None)
6262

6363
Wrap a :class:`concurrent.futures.Future` object in a
6464
:class:`asyncio.Future` object.
@@ -67,7 +67,7 @@ Future Functions
6767
Future Object
6868
=============
6969

70-
.. class:: Future(\*, loop=None)
70+
.. class:: Future(*, loop=None)
7171

7272
A Future represents an eventual result of an asynchronous
7373
operation. Not thread-safe.

Doc/library/asyncio-policy.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ implementation used by the asyncio event loop:
159159

160160
.. class:: AbstractChildWatcher
161161

162-
.. method:: add_child_handler(pid, callback, \*args)
162+
.. method:: add_child_handler(pid, callback, *args)
163163

164164
Register a new child handler.
165165

Doc/library/asyncio-stream.rst

+5-5
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ The following top-level asyncio functions can be used to create
4848
and work with streams:
4949

5050

51-
.. coroutinefunction:: open_connection(host=None, port=None, \*, \
51+
.. coroutinefunction:: open_connection(host=None, port=None, *, \
5252
loop=None, limit=None, ssl=None, family=0, \
5353
proto=0, flags=0, sock=None, local_addr=None, \
5454
server_hostname=None, ssl_handshake_timeout=None)
@@ -74,7 +74,7 @@ and work with streams:
7474
The *ssl_handshake_timeout* parameter.
7575

7676
.. coroutinefunction:: start_server(client_connected_cb, host=None, \
77-
port=None, \*, loop=None, limit=None, \
77+
port=None, *, loop=None, limit=None, \
7878
family=socket.AF_UNSPEC, \
7979
flags=socket.AI_PASSIVE, sock=None, \
8080
backlog=100, ssl=None, reuse_address=None, \
@@ -109,7 +109,7 @@ and work with streams:
109109

110110
.. rubric:: Unix Sockets
111111

112-
.. coroutinefunction:: open_unix_connection(path=None, \*, loop=None, \
112+
.. coroutinefunction:: open_unix_connection(path=None, *, loop=None, \
113113
limit=None, ssl=None, sock=None, \
114114
server_hostname=None, ssl_handshake_timeout=None)
115115

@@ -132,7 +132,7 @@ and work with streams:
132132

133133

134134
.. coroutinefunction:: start_unix_server(client_connected_cb, path=None, \
135-
\*, loop=None, limit=None, sock=None, \
135+
*, loop=None, limit=None, sock=None, \
136136
backlog=100, ssl=None, ssl_handshake_timeout=None, \
137137
start_serving=True)
138138
@@ -192,7 +192,7 @@ StreamReader
192192
can be read. Use the :attr:`IncompleteReadError.partial`
193193
attribute to get the partially read data.
194194

195-
.. coroutinemethod:: readuntil(separator=b'\\n')
195+
.. coroutinemethod:: readuntil(separator=b'\n')
196196

197197
Read data from the stream until *separator* is found.
198198

Doc/library/asyncio-subprocess.rst

+3-3
Original file line numberDiff line numberDiff line change
@@ -61,9 +61,9 @@ See also the `Examples`_ subsection.
6161
Creating Subprocesses
6262
=====================
6363

64-
.. coroutinefunction:: create_subprocess_exec(program, \*args, stdin=None, \
64+
.. coroutinefunction:: create_subprocess_exec(program, *args, stdin=None, \
6565
stdout=None, stderr=None, loop=None, \
66-
limit=None, \*\*kwds)
66+
limit=None, **kwds)
6767
6868
Create a subprocess.
6969

@@ -82,7 +82,7 @@ Creating Subprocesses
8282

8383
.. coroutinefunction:: create_subprocess_shell(cmd, stdin=None, \
8484
stdout=None, stderr=None, loop=None, \
85-
limit=None, \*\*kwds)
85+
limit=None, **kwds)
8686
8787
Run the *cmd* shell command.
8888

Doc/library/asyncio-task.rst

+8-8
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ is :meth:`loop.run_in_executor`.
210210
Running an asyncio Program
211211
==========================
212212

213-
.. function:: run(coro, \*, debug=False)
213+
.. function:: run(coro, *, debug=False)
214214

215215
Execute the :term:`coroutine` *coro* and return the result.
216216

@@ -245,7 +245,7 @@ Running an asyncio Program
245245
Creating Tasks
246246
==============
247247

248-
.. function:: create_task(coro, \*, name=None)
248+
.. function:: create_task(coro, *, name=None)
249249

250250
Wrap the *coro* :ref:`coroutine <coroutine>` into a :class:`Task`
251251
and schedule its execution. Return the Task object.
@@ -317,7 +317,7 @@ Sleeping
317317
Running Tasks Concurrently
318318
==========================
319319

320-
.. awaitablefunction:: gather(\*aws, loop=None, return_exceptions=False)
320+
.. awaitablefunction:: gather(*aws, loop=None, return_exceptions=False)
321321

322322
Run :ref:`awaitable objects <asyncio-awaitables>` in the *aws*
323323
sequence *concurrently*.
@@ -497,7 +497,7 @@ Timeouts
497497
Waiting Primitives
498498
==================
499499

500-
.. coroutinefunction:: wait(aws, \*, loop=None, timeout=None,\
500+
.. coroutinefunction:: wait(aws, *, loop=None, timeout=None,\
501501
return_when=ALL_COMPLETED)
502502

503503
Run :ref:`awaitable objects <asyncio-awaitables>` in the *aws*
@@ -585,7 +585,7 @@ Waiting Primitives
585585
deprecated.
586586

587587

588-
.. function:: as_completed(aws, \*, loop=None, timeout=None)
588+
.. function:: as_completed(aws, *, loop=None, timeout=None)
589589

590590
Run :ref:`awaitable objects <asyncio-awaitables>` in the *aws*
591591
iterable concurrently. Return an iterator of coroutines.
@@ -679,7 +679,7 @@ Introspection
679679
Task Object
680680
===========
681681

682-
.. class:: Task(coro, \*, loop=None, name=None)
682+
.. class:: Task(coro, *, loop=None, name=None)
683683

684684
A :class:`Future-like <Future>` object that runs a Python
685685
:ref:`coroutine <coroutine>`. Not thread-safe.
@@ -842,7 +842,7 @@ Task Object
842842
See the documentation of :meth:`Future.remove_done_callback`
843843
for more details.
844844

845-
.. method:: get_stack(\*, limit=None)
845+
.. method:: get_stack(*, limit=None)
846846

847847
Return the list of stack frames for this Task.
848848

@@ -863,7 +863,7 @@ Task Object
863863
stack are returned, but the oldest frames of a traceback are
864864
returned. (This matches the behavior of the traceback module.)
865865

866-
.. method:: print_stack(\*, limit=None, file=None)
866+
.. method:: print_stack(*, limit=None, file=None)
867867

868868
Print the stack or traceback for this Task.
869869

Doc/library/base64.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ The modern interface provides:
178178
.. versionadded:: 3.4
179179

180180

181-
.. function:: a85decode(b, *, foldspaces=False, adobe=False, ignorechars=b' \\t\\n\\r\\v')
181+
.. function:: a85decode(b, *, foldspaces=False, adobe=False, ignorechars=b' \t\n\r\v')
182182

183183
Decode the Ascii85 encoded :term:`bytes-like object` or ASCII string *b* and
184184
return the decoded :class:`bytes`.

Doc/library/contextvars.rst

+2-2
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ See also :pep:`567` for additional details.
2626
Context Variables
2727
-----------------
2828

29-
.. class:: ContextVar(name, [\*, default])
29+
.. class:: ContextVar(name, [*, default])
3030

3131
This class is used to declare a new Context Variable, e.g.::
3232

@@ -146,7 +146,7 @@ Manual Context Management
146146

147147
Context implements the :class:`collections.abc.Mapping` interface.
148148

149-
.. method:: run(callable, \*args, \*\*kwargs)
149+
.. method:: run(callable, *args, **kwargs)
150150

151151
Execute ``callable(*args, **kwargs)`` code in the context object
152152
the *run* method is called on. Return the result of the execution

Doc/library/ctypes.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -2508,7 +2508,7 @@ other data types containing pointer type fields.
25082508
Arrays and pointers
25092509
^^^^^^^^^^^^^^^^^^^
25102510

2511-
.. class:: Array(\*args)
2511+
.. class:: Array(*args)
25122512

25132513
Abstract base class for arrays.
25142514

Doc/library/difflib.rst

+3-3
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ diffs. For comparing directories and files, see also, the :mod:`filecmp` module.
149149
contains a good example of its use.
150150

151151

152-
.. function:: context_diff(a, b, fromfile='', tofile='', fromfiledate='', tofiledate='', n=3, lineterm='\\n')
152+
.. function:: context_diff(a, b, fromfile='', tofile='', fromfiledate='', tofiledate='', n=3, lineterm='\n')
153153

154154
Compare *a* and *b* (lists of strings); return a delta (a :term:`generator`
155155
generating the delta lines) in context diff format.
@@ -279,7 +279,7 @@ diffs. For comparing directories and files, see also, the :mod:`filecmp` module.
279279
emu
280280

281281

282-
.. function:: unified_diff(a, b, fromfile='', tofile='', fromfiledate='', tofiledate='', n=3, lineterm='\\n')
282+
.. function:: unified_diff(a, b, fromfile='', tofile='', fromfiledate='', tofiledate='', n=3, lineterm='\n')
283283

284284
Compare *a* and *b* (lists of strings); return a delta (a :term:`generator`
285285
generating the delta lines) in unified diff format.
@@ -321,7 +321,7 @@ diffs. For comparing directories and files, see also, the :mod:`filecmp` module.
321321

322322
See :ref:`difflib-interface` for a more detailed example.
323323

324-
.. function:: diff_bytes(dfunc, a, b, fromfile=b'', tofile=b'', fromfiledate=b'', tofiledate=b'', n=3, lineterm=b'\\n')
324+
.. function:: diff_bytes(dfunc, a, b, fromfile=b'', tofile=b'', fromfiledate=b'', tofiledate=b'', n=3, lineterm=b'\n')
325325

326326
Compare *a* and *b* (lists of bytes objects) using *dfunc*; yield a
327327
sequence of delta lines (also bytes) in the format returned by *dfunc*.

Doc/library/email.header.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ Here is the :class:`Header` class description:
116116
if *s* is a byte string.
117117

118118

119-
.. method:: encode(splitchars=';, \\t', maxlinelen=None, linesep='\\n')
119+
.. method:: encode(splitchars=';, \t', maxlinelen=None, linesep='\n')
120120

121121
Encode a message header into an RFC-compliant format, possibly wrapping
122122
long lines and encapsulating non-ASCII parts in base64 or quoted-printable

0 commit comments

Comments
 (0)