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