Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
86c4ea84
Commit
86c4ea84
authored
Aug 19, 2003
by
Barry Warsaw
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update get_param() description to reflect changes to the docstring.
parent
d60ac4ff
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
5 deletions
+8
-5
Doc/lib/emailmessage.tex
Doc/lib/emailmessage.tex
+8
-5
No files found.
Doc/lib/emailmessage.tex
View file @
86c4ea84
...
...
@@ -354,15 +354,18 @@ instead of \mailheader{Content-Type}.
Parameter keys are always compared case insensitively. The return
value can either be a string, or a 3-tuple if the parameter was
\rfc
{
2231
}
encoded. When it's a 3-tuple, the elements of the value are of
the form
\code
{
(CHARSET, LANGUAGE, VALUE)
}
, where
\code
{
LANGUAGE
}
may
be the empty string. Your application should be prepared to deal with
3-tuple return values, which it can convert to a Unicode string like
so:
the form
\code
{
(CHARSET, LANGUAGE, VALUE)
}
. Note that both
\code
{
CHARSET
}
and
\code
{
LANGUAGE
}
can be
\code
{
None
}
, in which case you should consider
\code
{
VALUE
}
to be encoded in the
\code
{
us-ascii
}
charset. You can
usually ignore
\code
{
LANGUAGE
}
.
Your application should be prepared to deal with 3-tuple return
values, and can convert the parameter to a Unicode string like so:
\begin{verbatim}
param = msg.get
_
param('foo')
if isinstance(param, tuple):
param = unicode(param[2], param[0])
param = unicode(param[2], param[0]
or 'us-ascii'
)
\end{verbatim}
In any case, the parameter value (either the returned string, or the
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment