]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
#15980: properly escape newlines in docstrings. Patch by Serhiy Storchaka.
authorEzio Melotti <ezio.melotti@gmail.com>
Fri, 21 Sep 2012 13:27:45 +0000 (16:27 +0300)
committerEzio Melotti <ezio.melotti@gmail.com>
Fri, 21 Sep 2012 13:27:45 +0000 (16:27 +0300)
Lib/_LWPCookieJar.py
Lib/email/base64mime.py
Lib/email/utils.py
Lib/rfc822.py

index 2a4fa7b2f68d21f4c996a0ab4eb21e85c57749ff..90cc633d53164d02a3bb1fbbb059cf8c9004732a 100644 (file)
@@ -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
 
index 8804427b26bbb45abd534b0c84703eb3a4cce616..4aa800026d650f33971729ba67d00bb1931547f9 100644 (file)
@@ -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:
index 6d22ca7e09eb8bafefc67a42b5cfb5c926fc6618..c976021e0e0584c6ee56d5aa32b0034c531349c5 100644 (file)
@@ -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):
 
 \f
 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'(?<!\r)\n', CRLF, s)
     # Fix carriage returns with no following newline
index 3b29a6a5d8d104f6bba4e56c9108fd5b9140e962..b65d8da0d25babd71cd52720e1e422524e38d921 100644 (file)
@@ -212,7 +212,7 @@ class Message:
         You may override this method if your application wants to bend the
         rules, e.g. to strip trailing whitespace, or to recognize MH template
         separators ('--------').  For convenience (e.g. for code reading from
-        sockets) a line consisting of \r\n also matches.
+        sockets) a line consisting of \\r\\n also matches.
         """
         return line in _blanklines