classification
Title: cgi.parse_multipart is not consistent with FieldStorage
Type: behavior Stage: resolved
Components: Library (Lib) Versions: Python 3.7
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: orsenthil Nosy List: orsenthil, quentel
Priority: normal Keywords:

Created on 2017-04-04 08:58 by quentel, last changed 2017-05-08 12:09 by orsenthil. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 990 closed quentel, 2017-04-04 12:58
PR 991 merged quentel, 2017-04-04 14:00
Messages (4)
msg291117 - (view) Author: Pierre Quentel (quentel) * Date: 2017-04-04 08:58
In the cgi module, the parse_multipart() function duplicates code from FieldStorage, and the result is not compliant with that of FieldStorage for requests sent with multipart/form-data : for non-file fields, the value associated with a key is a list of *bytes* in parse_multipart() and a list of *strings* for FieldStorage (the bytes decoded with the argument "encoding" passed to FieldStorage()).

I will propose a PR on the Github repo with a version of parse_multipart that uses FieldStorage and returns the same result (values as strings). The function will take an additional argument "encoding".
msg291122 - (view) Author: Senthil Kumaran (orsenthil) * (Python committer) Date: 2017-04-04 13:30
Looking forward to this.
msg291491 - (view) Author: Pierre Quentel (quentel) * Date: 2017-04-11 13:25
Senthil,

Can you take a look at the Pull Request when you have time ? The correct PR is #991, not #990.
msg293233 - (view) Author: Senthil Kumaran (orsenthil) * (Python committer) Date: 2017-05-08 12:08
New changeset cc3fa204d357be5fafc10eb8c2a80fe0bca998f1 by Senthil Kumaran (Pierre Quentel) in branch 'master':
bpo-29979: Rewrite cgi.parse_multipart to make it consistent with FieldStorage (#991)
https://github.com/python/cpython/commit/cc3fa204d357be5fafc10eb8c2a80fe0bca998f1
History
Date User Action Args
2017-05-08 12:09:05orsenthilsetstatus: open -> closed
resolution: fixed
stage: resolved
2017-05-08 12:08:36orsenthilsetmessages: + msg293233
2017-04-11 13:25:14quentelsetmessages: + msg291491
2017-04-04 14:00:08quentelsetpull_requests: + pull_request1163
2017-04-04 13:30:16orsenthilsetassignee: orsenthil

messages: + msg291122
nosy: + orsenthil
2017-04-04 12:58:52quentelsetpull_requests: + pull_request1162
2017-04-04 08:58:51quentelcreate