Skip to content

Commit 218ed0b

Browse files
authored
Revert "[3.8] [doc] Fix erroneous backslashes in signatures and names (GH-23658)" (GH-24093)
This partially reverts commit 02349e2, which was removing backslashes in documentations compiled with Sphinx < 3, used for Python 3.8 and 3.9 docs.
1 parent f24ac45 commit 218ed0b

9 files changed

+11
-11
lines changed

Doc/library/asyncio-stream.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -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/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/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

Doc/library/functions.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -1312,7 +1312,7 @@ are always available. They are listed here in alphabetical order.
13121312
supported.
13131313

13141314

1315-
.. function:: print(*objects, sep=' ', end='\n', file=sys.stdout, flush=False)
1315+
.. function:: print(*objects, sep=' ', end='\\n', file=sys.stdout, flush=False)
13161316

13171317
Print *objects* to the text stream *file*, separated by *sep* and followed
13181318
by *end*. *sep*, *end*, *file* and *flush*, if present, must be given as keyword

Doc/library/http.cookies.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ Cookie Objects
9393
:meth:`value_decode` are inverses on the range of *value_decode*.
9494

9595

96-
.. method:: BaseCookie.output(attrs=None, header='Set-Cookie:', sep='\r\n')
96+
.. method:: BaseCookie.output(attrs=None, header='Set-Cookie:', sep='\\r\\n')
9797

9898
Return a string representation suitable to be sent as HTTP headers. *attrs* and
9999
*header* are sent to each :class:`Morsel`'s :meth:`output` method. *sep* is used

Doc/library/io.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -959,7 +959,7 @@ Text I/O
959959
.. versionadded:: 3.7
960960

961961

962-
.. class:: StringIO(initial_value='', newline='\n')
962+
.. class:: StringIO(initial_value='', newline='\\n')
963963

964964
An in-memory stream for text I/O. The text buffer is discarded when the
965965
:meth:`~IOBase.close` method is called.

Doc/library/xml.dom.minidom.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ module documentation. This section lists the differences between the API and
164164
The :meth:`toxml` method now preserves the attribute order specified
165165
by the user.
166166

167-
.. method:: Node.toprettyxml(indent="\t", newl="\n", encoding=None)
167+
.. method:: Node.toprettyxml(indent="\\t", newl="\\n", encoding=None)
168168

169169
Return a pretty-printed version of the document. *indent* specifies the
170170
indentation string and defaults to a tabulator; *newl* specifies the string

Doc/requirements.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# Sphinx version is pinned so that new versions that introduce new warnings
44
# won't suddenly cause build failures. Updating the version is fine as long
55
# as no warnings are raised by doing so.
6-
sphinx
6+
sphinx==2.4.4
77

88
blurb
99

0 commit comments

Comments
 (0)