diff options
author | Pierre Quentel <pierre.quentel@gmail.com> | 2017-05-08 12:08:34 (GMT) |
---|---|---|
committer | Senthil Kumaran <skumaran@gatech.edu> | 2017-05-08 12:08:34 (GMT) |
commit | cc3fa204d357be5fafc10eb8c2a80fe0bca998f1 (patch) | |
tree | bd84defa311575c96461db01238cd231d94c439f /Doc/library | |
parent | f34c6850203a2406c4950af7a9c8a134145df4ea (diff) | |
download | cpython-cc3fa204d357be5fafc10eb8c2a80fe0bca998f1.zip cpython-cc3fa204d357be5fafc10eb8c2a80fe0bca998f1.tar.gz cpython-cc3fa204d357be5fafc10eb8c2a80fe0bca998f1.tar.bz2 |
bpo-29979: Rewrite cgi.parse_multipart to make it consistent with FieldStorage (#991)
Diffstat (limited to 'Doc/library')
-rw-r--r-- | Doc/library/cgi.rst | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/Doc/library/cgi.rst b/Doc/library/cgi.rst index 41219ee..b60e1cc 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) |