Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 3ac8c78

Browse files
committed
Update out of date docstring.
1 parent f90ea1f commit 3ac8c78

1 file changed

Lines changed: 5 additions & 7 deletions

File tree

Lib/email/message.py

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -613,17 +613,15 @@ def get_param(self, param, failobj=None, header='content-type',
613613
the form (CHARSET, LANGUAGE, VALUE). Note that both CHARSET and
614614
LANGUAGE can be None, in which case you should consider VALUE to be
615615
encoded in the us-ascii charset. You can usually ignore LANGUAGE.
616+
The parameter value (either the returned string, or the VALUE item in
617+
the 3-tuple) is always unquoted, unless unquote is set to False.
616618
617-
Your application should be prepared to deal with 3-tuple return
618-
values, and can convert the parameter to a Unicode string like so:
619+
If your application doesn't care whether the parameter was RFC 2231
620+
encoded, it can turn the return value into a string as follows:
619621
620622
param = msg.get_param('foo')
621-
if isinstance(param, tuple):
622-
param = unicode(param[2], param[0] or 'us-ascii')
623+
param = email.utils.collapse_rfc2231_value(rawparam)
623624
624-
In any case, the parameter value (either the returned string, or the
625-
VALUE item in the 3-tuple) is always unquoted, unless unquote is set
626-
to False.
627625
"""
628626
if header not in self:
629627
return failobj

0 commit comments

Comments
 (0)