summaryrefslogtreecommitdiff
path: root/Doc/library/cgi.rst
diff options
context:
space:
mode:
authorPierre Quentel <pierre.quentel@gmail.com>2017-05-08 14:08:34 +0200
committerSenthil Kumaran <skumaran@gatech.edu>2017-05-08 05:08:34 -0700
commitcc3fa204d357be5fafc10eb8c2a80fe0bca998f1 (patch)
treebd84defa311575c96461db01238cd231d94c439f /Doc/library/cgi.rst
parentf34c6850203a2406c4950af7a9c8a134145df4ea (diff)
downloadcpython-git-cc3fa204d357be5fafc10eb8c2a80fe0bca998f1.tar.gz
bpo-29979: Rewrite cgi.parse_multipart to make it consistent with FieldStorage (#991)
Diffstat (limited to 'Doc/library/cgi.rst')
-rw-r--r--Doc/library/cgi.rst19
1 files changed, 10 insertions, 9 deletions
diff --git a/Doc/library/cgi.rst b/Doc/library/cgi.rst
index 41219eeaab..b60e1cc41e 100644
--- a/Doc/library/cgi.rst
+++ b/Doc/library/cgi.rst
@@ -294,19 +294,20 @@ algorithms implemented in this module in other circumstances.
This function is deprecated in this module. Use :func:`urllib.parse.parse_qsl`
instead. It is maintained here only for backward compatibility.
-.. function:: parse_multipart(fp, pdict)
+.. function:: parse_multipart(fp, pdict, encoding="utf-8")
Parse input of type :mimetype:`multipart/form-data` (for file uploads).
- Arguments are *fp* for the input file and *pdict* for a dictionary containing
- other parameters in the :mailheader:`Content-Type` header.
+ Arguments are *fp* for the input file, *pdict* for a dictionary containing
+ other parameters in the :mailheader:`Content-Type` header, and *encoding*,
+ the request encoding.
- Returns a dictionary just like :func:`urllib.parse.parse_qs` keys are the field names, each
- value is a list of values for that field. This is easy to use but not much good
- if you are expecting megabytes to be uploaded --- in that case, use the
- :class:`FieldStorage` class instead which is much more flexible.
+ Returns a dictionary just like :func:`urllib.parse.parse_qs`: keys are the
+ field names, each value is a list of values for that field. For non-file
+ fields, the value is a list of strings.
- Note that this does not parse nested multipart parts --- use
- :class:`FieldStorage` for that.
+ This is easy to use but not much good if you are expecting megabytes to be
+ uploaded --- in that case, use the :class:`FieldStorage` class instead
+ which is much more flexible.
.. function:: parse_header(string)