]> granicus.if.org Git - python/commitdiff
Harmonize linesep docstrings, and fix the quoting of \r\n
authorR David Murray <rdmurray@bitdance.com>
Mon, 14 Mar 2011 22:35:56 +0000 (18:35 -0400)
committerR David Murray <rdmurray@bitdance.com>
Mon, 14 Mar 2011 22:35:56 +0000 (18:35 -0400)
Lib/email/generator.py
Lib/email/header.py

index 531fa9a7a4326b163c51a476d8a020753c519a6d..f0e7a95477d61055b1e64f1f30b9f100375858c4 100644 (file)
@@ -59,7 +59,7 @@ class Generator:
         self._fp.write(s)
 
     def flatten(self, msg, unixfrom=False, linesep='\n'):
-        """Print the message object tree rooted at msg to the output file
+        r"""Print the message object tree rooted at msg to the output file
         specified when the Generator instance was created.
 
         unixfrom is a flag that forces the printing of a Unix From_ delimiter
@@ -70,7 +70,10 @@ class Generator:
         Note that for subobjects, no From_ line is printed.
 
         linesep specifies the characters used to indicate a new line in
-        the output.
+        the output.  The default value is the most useful for typical
+        Python applications, but it can be set to \r\n to produce RFC-compliant
+        line separators when needed.
+
         """
         # We use the _XXX constants for operating on data that comes directly
         # from the msg, and _encoded_XXX constants for operating on data that
index 35cdb2b4056bdfcbe03bff5f2db4d17a04f4d862..e1716176fa0890b6ff71211905c080f2e8a25c57 100644 (file)
@@ -276,7 +276,7 @@ class Header:
         self._chunks.append((s, charset))
 
     def encode(self, splitchars=';, \t', maxlinelen=None, linesep='\n'):
-        """Encode a message header into an RFC-compliant format.
+        r"""Encode a message header into an RFC-compliant format.
 
         There are many issues involved in converting a given string for use in
         an email header.  Only certain character sets are readable in most