[Python-checkins] cpython (merge 3.2 -> default): Merge linesep docstring changes from 3.2.

r.david.murray python-checkins at python.org
Mon Mar 14 23:39:58 CET 2011


http://hg.python.org/cpython/rev/cfa6845fbed8
changeset:   68472:cfa6845fbed8
parent:      68470:ecc176488349
parent:      68471:f6cab3819160
user:        R David Murray <rdmurray at bitdance.com>
date:        Mon Mar 14 18:39:41 2011 -0400
summary:
  Merge linesep docstring changes from 3.2.

files:
  

diff --git a/Lib/email/generator.py b/Lib/email/generator.py
--- a/Lib/email/generator.py
+++ b/Lib/email/generator.py
@@ -59,7 +59,7 @@
         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 @@
         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
diff --git a/Lib/email/header.py b/Lib/email/header.py
--- a/Lib/email/header.py
+++ b/Lib/email/header.py
@@ -276,7 +276,7 @@
         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

-- 
Repository URL: http://hg.python.org/cpython


More information about the Python-checkins mailing list