Skip to content

Commit 50ef0f4

Browse files
Escaped backslashes in docstrings.
2 parents 32ed750 + 9f8a891 commit 50ef0f4

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
@@ -1065,7 +1065,7 @@ def make_encoding_map(decoding_map):
10651065
during translation.
10661066
10671067
One example where this happens is cp875.py which decodes
1068-
multiple character to \u001a.
1068+
multiple character to \\u001a.
10691069
10701070
"""
10711071
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
@@ -1380,7 +1380,7 @@ def captured_stdout():
13801380
13811381
with captured_stdout() as stdout:
13821382
print("hello")
1383-
self.assertEqual(stdout.getvalue(), "hello\n")
1383+
self.assertEqual(stdout.getvalue(), "hello\\n")
13841384
"""
13851385
return captured_output("stdout")
13861386

@@ -1389,15 +1389,15 @@ def captured_stderr():
13891389
13901390
with captured_stderr() as stderr:
13911391
print("hello", file=sys.stderr)
1392-
self.assertEqual(stderr.getvalue(), "hello\n")
1392+
self.assertEqual(stderr.getvalue(), "hello\\n")
13931393
"""
13941394
return captured_output("stderr")
13951395

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

Lib/textwrap.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ def _munge_whitespace(self, text):
148148
"""_munge_whitespace(text : string) -> string
149149
150150
Munge whitespace in text: expand tabs and convert all other
151-
whitespace characters to spaces. Eg. " foo\tbar\n\nbaz"
151+
whitespace characters to spaces. Eg. " foo\\tbar\\n\\nbaz"
152152
becomes " foo bar baz".
153153
"""
154154
if self.expand_tabs:
@@ -184,7 +184,7 @@ def _fix_sentence_endings(self, chunks):
184184
"""_fix_sentence_endings(chunks : [string])
185185
186186
Correct for sentence endings buried in 'chunks'. Eg. when the
187-
original text contains "... foo.\nBar ...", munge_whitespace()
187+
original text contains "... foo.\\nBar ...", munge_whitespace()
188188
and split() will convert that to [..., "foo.", " ", "Bar", ...]
189189
which has one too few spaces; this method simply changes the one
190190
space to two.
@@ -420,7 +420,7 @@ def dedent(text):
420420
in indented form.
421421
422422
Note that tabs and spaces are both treated as whitespace, but they
423-
are not equal: the lines " hello" and "\thello" are
423+
are not equal: the lines " hello" and "\\thello" are
424424
considered to have no common leading whitespace. (This behaviour is
425425
new in Python 2.5; older versions of this module incorrectly
426426
expanded tabs before searching for common leading whitespace.)

0 commit comments

Comments
 (0)