mirror of
https://github.com/python/cpython.git
synced 2025-07-25 20:24:11 +00:00
Update out of date docstring.
This commit is contained in:
parent
f90ea1f0a0
commit
3ac8c780f4
1 changed files with 5 additions and 7 deletions
|
@ -613,17 +613,15 @@ class Message:
|
||||||
the form (CHARSET, LANGUAGE, VALUE). Note that both CHARSET and
|
the form (CHARSET, LANGUAGE, VALUE). Note that both CHARSET and
|
||||||
LANGUAGE can be None, in which case you should consider VALUE to be
|
LANGUAGE can be None, in which case you should consider VALUE to be
|
||||||
encoded in the us-ascii charset. You can usually ignore LANGUAGE.
|
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
|
If your application doesn't care whether the parameter was RFC 2231
|
||||||
values, and can convert the parameter to a Unicode string like so:
|
encoded, it can turn the return value into a string as follows:
|
||||||
|
|
||||||
param = msg.get_param('foo')
|
param = msg.get_param('foo')
|
||||||
if isinstance(param, tuple):
|
param = email.utils.collapse_rfc2231_value(rawparam)
|
||||||
param = unicode(param[2], param[0] or 'us-ascii')
|
|
||||||
|
|
||||||
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:
|
if header not in self:
|
||||||
return failobj
|
return failobj
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue