@@ -137,7 +137,7 @@ or on combining URL components into a URL string.
137
137
returning :const: `None `.
138
138
139
139
140
- .. function :: parse_qs(qs, keep_blank_values=False, strict_parsing=False, encoding='utf-8', errors='replace')
140
+ .. function :: parse_qs(qs, keep_blank_values=False, strict_parsing=False, encoding='utf-8', errors='replace', max_num_fields=None )
141
141
142
142
Parse a query string given as a string argument (data of type
143
143
:mimetype: `application/x-www-form-urlencoded `). Data are returned as a
@@ -158,6 +158,10 @@ or on combining URL components into a URL string.
158
158
percent-encoded sequences into Unicode characters, as accepted by the
159
159
:meth: `bytes.decode ` method.
160
160
161
+ The optional argument *max_num_fields * is a flag for the maximum number of
162
+ fields to read. If set, then throws a :exc: `ValueError ` if there are more
163
+ than *max_num_fields * fields read. Default is *None *.
164
+
161
165
Use the :func: `urllib.parse.urlencode ` function (with the ``doseq ``
162
166
parameter set to ``True ``) to convert such dictionaries into query
163
167
strings.
@@ -166,8 +170,11 @@ or on combining URL components into a URL string.
166
170
.. versionchanged :: 3.2
167
171
Add *encoding * and *errors * parameters.
168
172
173
+ .. versionchanged :: 3.8
174
+ Added *max_num_fields * param.
175
+
169
176
170
- .. function :: parse_qsl(qs, keep_blank_values=False, strict_parsing=False, encoding='utf-8', errors='replace')
177
+ .. function :: parse_qsl(qs, keep_blank_values=False, strict_parsing=False, encoding='utf-8', errors='replace', max_num_fields=None )
171
178
172
179
Parse a query string given as a string argument (data of type
173
180
:mimetype: `application/x-www-form-urlencoded `). Data are returned as a list of
@@ -187,12 +194,19 @@ or on combining URL components into a URL string.
187
194
percent-encoded sequences into Unicode characters, as accepted by the
188
195
:meth: `bytes.decode ` method.
189
196
197
+ The optional argument *max_num_fields * is a flag for the maximum number of
198
+ fields to read. If set, then throws a :exc: `ValueError ` if there are more
199
+ than *max_num_fields * fields read. Default is *None *.
200
+
190
201
Use the :func: `urllib.parse.urlencode ` function to convert such lists of pairs into
191
202
query strings.
192
203
193
204
.. versionchanged :: 3.2
194
205
Add *encoding * and *errors * parameters.
195
206
207
+ .. versionchanged :: 3.8
208
+ Added *max_num_fields * param.
209
+
196
210
197
211
.. function :: urlunparse(parts)
198
212
0 commit comments