summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorR David Murray <rdmurray@bitdance.com>2012-06-17 19:27:21 (GMT)
committerR David Murray <rdmurray@bitdance.com>2012-06-17 19:27:21 (GMT)
commit7636b193661f19eb21d35437c9f022cc7fc80e9f (patch)
tree09e961ccb2018eeca4571a8f4b68bf39b8da5d72
parent5b1406fbceb40c3d042c7b56c30d640b70a1134a (diff)
parent3ac8c780f4fdb32f07b03954e38e23a1ce6fb99c (diff)
downloadcpython-7636b193661f19eb21d35437c9f022cc7fc80e9f.zip
cpython-7636b193661f19eb21d35437c9f022cc7fc80e9f.tar.gz
cpython-7636b193661f19eb21d35437c9f022cc7fc80e9f.tar.bz2
Merge: Update out of date docstring.
-rw-r--r--Lib/email/message.py12
1 files changed, 5 insertions, 7 deletions
diff --git a/Lib/email/message.py b/Lib/email/message.py
index 9b06207..3feab52 100644
--- a/Lib/email/message.py
+++ b/Lib/email/message.py
@@ -628,17 +628,15 @@ class Message:
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