Skip to content

Commit 7b398f1

Browse files
author
Pierre Quentel
committed
Remove mention of FieldStorage in docstring + more explicit comment on boundary encoding
1 parent 77585f7 commit 7b398f1

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

Lib/cgi.py

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -209,14 +209,10 @@ def parse_multipart(fp, pdict, encoding="utf-8"):
209209
Returns a dictionary just like parse_qs(): keys are the field names, each
210210
value is a list of values for that field. For non-file fields, the value
211211
is a list of strings.
212-
213-
This is easy to use but not much good if you are expecting megabytes to be
214-
uploaded -- in that case, use the FieldStorage class instead which is much
215-
more flexible. Note that content-type is the raw, unparsed contents of
216-
the content-type header.
217-
218212
"""
219-
boundary = pdict['boundary'].decode('ascii') # cf. RFC 2046
213+
# RFC 2026, Section 5.1 : The "multipart" boundary delimiters are always
214+
# represented as 7bit US-ASCII.
215+
boundary = pdict['boundary'].decode('ascii')
220216
ctype = "multipart/form-data; boundary={}".format(boundary)
221217
headers = Message()
222218
headers.set_type(ctype)

0 commit comments

Comments
 (0)