[Python-checkins] cpython (3.2): Update out of date docstring.
r.david.murray
python-checkins at python.org
Sun Jun 17 21:27:41 CEST 2012
http://hg.python.org/cpython/rev/6fbbf4ec6db5
changeset: 77498:6fbbf4ec6db5
branch: 3.2
parent: 77496:3550416d83b3
user: R David Murray <rdmurray at bitdance.com>
date: Sun Jun 17 15:26:35 2012 -0400
summary:
Update out of date docstring.
files:
Lib/email/message.py | 12 +++++-------
1 files changed, 5 insertions(+), 7 deletions(-)
diff --git a/Lib/email/message.py b/Lib/email/message.py
--- a/Lib/email/message.py
+++ b/Lib/email/message.py
@@ -613,17 +613,15 @@
the form (CHARSET, LANGUAGE, VALUE). Note that both CHARSET and
LANGUAGE can be None, in which case you should consider VALUE to be
encoded in the us-ascii charset. You can usually ignore LANGUAGE.
+ The parameter value (either the returned string, or the VALUE item in
+ the 3-tuple) is always unquoted, unless unquote is set to False.
- Your application should be prepared to deal with 3-tuple return
- values, and can convert the parameter to a Unicode string like so:
+ If your application doesn't care whether the parameter was RFC 2231
+ encoded, it can turn the return value into a string as follows:
param = msg.get_param('foo')
- if isinstance(param, tuple):
- param = unicode(param[2], param[0] or 'us-ascii')
+ param = email.utils.collapse_rfc2231_value(rawparam)
- In any case, the parameter value (either the returned string, or the
- VALUE item in the 3-tuple) is always unquoted, unless unquote is set
- to False.
"""
if header not in self:
return failobj
--
Repository URL: http://hg.python.org/cpython
More information about the Python-checkins
mailing list