Escaped backslashes in docstrings. · python/cpython@50ef0f4 · GitHub
Skip to content

Commit 50ef0f4

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

7 files changed

Lines changed: 13 additions & 13 deletions

File tree

Lib/base64.py

Lines changed: 2 additions & 2 deletions

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

0 commit comments

Comments
 (0)