Skip to content

Commit 9f8a891

Browse files
Escaped backslashes in docstrings.
1 parent 72dcb0a commit 9f8a891

File tree

7 files changed

+13
-13
lines changed

7 files changed

+13
-13
lines changed

Lib/base64.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -324,7 +324,7 @@ def a85encode(b, *, foldspaces=False, wrapcol=0, pad=False, adobe=False):
324324
instead of 4 consecutive spaces (ASCII 0x20) as supported by 'btoa'. This
325325
feature is not supported by the "standard" Adobe encoding.
326326
327-
wrapcol controls whether the output should have newline ('\n') characters
327+
wrapcol controls whether the output should have newline ('\\n') characters
328328
added to it. If this is non-zero, each output line will be at most this
329329
many characters long.
330330
@@ -434,7 +434,7 @@ def a85decode(b, *, foldspaces=False, adobe=False, ignorechars=b' \t\n\r\v'):
434434
def b85encode(b, pad=False):
435435
"""Encode an ASCII-encoded byte array in base85 format.
436436
437-
If pad is true, the input is padded with "\0" so its length is a multiple of
437+
If pad is true, the input is padded with "\\0" so its length is a multiple of
438438
4 characters before encoding.
439439
"""
440440
global _b85chars, _b85chars2

Lib/codecs.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1061,7 +1061,7 @@ def make_encoding_map(decoding_map):
10611061
during translation.
10621062
10631063
One example where this happens is cp875.py which decodes
1064-
multiple character to \u001a.
1064+
multiple character to \\u001a.
10651065
10661066
"""
10671067
m = {}

Lib/email/_encoded_words.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ def decode(ew):
152152
then from the resulting bytes into unicode using the specified charset. If
153153
the cte-decoded string does not successfully decode using the specified
154154
character set, a defect is added to the defects list and the unknown octets
155-
are replaced by the unicode 'unknown' character \uFDFF.
155+
are replaced by the unicode 'unknown' character \\uFDFF.
156156
157157
The specified charset and language are returned. The default for language,
158158
which is rarely if ever encountered, is the empty string.

Lib/idlelib/SearchEngine.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ def search_reverse(prog, chars, col):
191191
192192
This is done by searching forwards until there is no match.
193193
Prog: compiled re object with a search method returning a match.
194-
Chars: line of text, without \n.
194+
Chars: line of text, without \\n.
195195
Col: stop index for the search; the limit for match.end().
196196
'''
197197
m = prog.search(chars)

Lib/smtplib.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -518,8 +518,8 @@ def data(self, msg):
518518
Raises SMTPDataError if there is an unexpected reply to the
519519
DATA command; the return value from this method is the final
520520
response code received when the all data is sent. If msg
521-
is a string, lone '\r' and '\n' characters are converted to
522-
'\r\n' characters. If msg is bytes, it is transmitted as is.
521+
is a string, lone '\\r' and '\\n' characters are converted to
522+
'\\r\\n' characters. If msg is bytes, it is transmitted as is.
523523
"""
524524
self.putcmd("data")
525525
(code, repl) = self.getreply()

Lib/test/support/__init__.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1379,7 +1379,7 @@ def captured_stdout():
13791379
13801380
with captured_stdout() as stdout:
13811381
print("hello")
1382-
self.assertEqual(stdout.getvalue(), "hello\n")
1382+
self.assertEqual(stdout.getvalue(), "hello\\n")
13831383
"""
13841384
return captured_output("stdout")
13851385

@@ -1388,15 +1388,15 @@ def captured_stderr():
13881388
13891389
with captured_stderr() as stderr:
13901390
print("hello", file=sys.stderr)
1391-
self.assertEqual(stderr.getvalue(), "hello\n")
1391+
self.assertEqual(stderr.getvalue(), "hello\\n")
13921392
"""
13931393
return captured_output("stderr")
13941394

13951395
def captured_stdin():
13961396
"""Capture the input to sys.stdin:
13971397
13981398
with captured_stdin() as stdin:
1399-
stdin.write('hello\n')
1399+
stdin.write('hello\\n')
14001400
stdin.seek(0)
14011401
# call test code that consumes from sys.stdin
14021402
captured = input()

Lib/textwrap.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ def _munge_whitespace(self, text):
133133
"""_munge_whitespace(text : string) -> string
134134
135135
Munge whitespace in text: expand tabs and convert all other
136-
whitespace characters to spaces. Eg. " foo\tbar\n\nbaz"
136+
whitespace characters to spaces. Eg. " foo\\tbar\\n\\nbaz"
137137
becomes " foo bar baz".
138138
"""
139139
if self.expand_tabs:
@@ -169,7 +169,7 @@ def _fix_sentence_endings(self, chunks):
169169
"""_fix_sentence_endings(chunks : [string])
170170
171171
Correct for sentence endings buried in 'chunks'. Eg. when the
172-
original text contains "... foo.\nBar ...", munge_whitespace()
172+
original text contains "... foo.\\nBar ...", munge_whitespace()
173173
and split() will convert that to [..., "foo.", " ", "Bar", ...]
174174
which has one too few spaces; this method simply changes the one
175175
space to two.
@@ -405,7 +405,7 @@ def dedent(text):
405405
in indented form.
406406
407407
Note that tabs and spaces are both treated as whitespace, but they
408-
are not equal: the lines " hello" and "\thello" are
408+
are not equal: the lines " hello" and "\\thello" are
409409
considered to have no common leading whitespace. (This behaviour is
410410
new in Python 2.5; older versions of this module incorrectly
411411
expanded tabs before searching for common leading whitespace.)

0 commit comments

Comments
 (0)