From: Ezio Melotti Date: Fri, 21 Sep 2012 13:27:45 +0000 (+0300) Subject: #15980: properly escape newlines in docstrings. Patch by Serhiy Storchaka. X-Git-Tag: v2.7.4rc1~548 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=003014bf1e7efcfcad19bd391b206e111ea21083;p=thirdparty%2FPython%2Fcpython.git #15980: properly escape newlines in docstrings. Patch by Serhiy Storchaka. --- diff --git a/Lib/_LWPCookieJar.py b/Lib/_LWPCookieJar.py index 2a4fa7b2f68d..90cc633d5316 100644 --- a/Lib/_LWPCookieJar.py +++ b/Lib/_LWPCookieJar.py @@ -48,7 +48,7 @@ def lwp_cookie_str(cookie): class LWPCookieJar(FileCookieJar): """ - The LWPCookieJar saves a sequence of"Set-Cookie3" lines. + The LWPCookieJar saves a sequence of "Set-Cookie3" lines. "Set-Cookie3" is the format used by the libwww-perl libary, not known to be compatible with any browser, but which is easy to read and doesn't lose information about RFC 2965 cookies. @@ -60,7 +60,7 @@ class LWPCookieJar(FileCookieJar): """ def as_lwp_str(self, ignore_discard=True, ignore_expires=True): - """Return cookies as a string of "\n"-separated "Set-Cookie3" headers. + """Return cookies as a string of "\\n"-separated "Set-Cookie3" headers. ignore_discard and ignore_expires: see docstring for FileCookieJar.save diff --git a/Lib/email/base64mime.py b/Lib/email/base64mime.py index 8804427b26bb..4aa800026d65 100644 --- a/Lib/email/base64mime.py +++ b/Lib/email/base64mime.py @@ -130,7 +130,7 @@ def encode(s, binary=True, maxlinelen=76, eol=NL): verbatim (this is the default). Each line of encoded text will end with eol, which defaults to "\\n". Set - this to "\r\n" if you will be using the result of this function directly + this to "\\r\\n" if you will be using the result of this function directly in an email. """ if not s: diff --git a/Lib/email/utils.py b/Lib/email/utils.py index 6d22ca7e09eb..c976021e0e05 100644 --- a/Lib/email/utils.py +++ b/Lib/email/utils.py @@ -63,7 +63,7 @@ def _bdecode(s): """Decodes a base64 string. This function is equivalent to base64.decodestring and it's retained only - for backward compatibility. It used to remove the last \n of the decoded + for backward compatibility. It used to remove the last \\n of the decoded string, if it had any (see issue 7143). """ if not s: @@ -73,7 +73,7 @@ def _bdecode(s): def fix_eols(s): - """Replace all line-ending characters with \r\n.""" + """Replace all line-ending characters with \\r\\n.""" # Fix newlines with no preceding carriage return s = re.sub(r'(?