8000 Adding Doc/library entries for max_num_fields · matthewbelisle-wf/cpython@98ace4b · GitHub
[go: up one dir, main page]

Skip to content

Commit 98ace4b

Browse files
Adding Doc/library entries for max_num_fields
1 parent a80af77 commit 98ace4b

File tree

1 file changed

+16
-2
lines changed

1 file changed

+16
-2
lines changed

Doc/library/urllib.parse.rst

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ or on combining URL components into a URL string.
137137
returning :const:`None`.
138138

139139

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)
141141

142142
Parse a query string given as a string argument (data of type
143143
:mimetype:`application/x-www-form-urlencoded`). Data are returned as a
@@ -158,6 +158,10 @@ or on combining URL components into a URL string.
158158
percent-encoded sequences into Unicode characters, as accepted by the
159159
:meth:`bytes.decode` method.
160160

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+
161165
Use the :func:`urllib.parse.urlencode` function (with the ``doseq``
162166
parameter set to ``True``) to convert such dictionaries into query
163167
strings.
@@ -166,8 +170,11 @@ or on combining URL components into a URL string.
166170
.. versionchanged:: 3.2
167171
Add *encoding* and *errors* parameters.
168172

173+
.. versionchanged:: 3.8
174+
Added *max_num_fields* param.
175+
169176

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)
171178

172179
Parse a query string given as a string argument (data of type
173180
: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.
187194
percent-encoded sequences into Unicode characters, as accepted by the
188195
:meth:`bytes.decode` method.
189196

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+
190201
Use the :func:`urllib.parse.urlencode` function to convert such lists of pairs into
191202
query strings.
192203

193204
.. versionchanged:: 3.2
194205
Add *encoding* and *errors* parameters.
195206

207+
.. versionchanged:: 3.8
208+
Added *max_num_fields* param.
209+
196210

197211
.. function:: urlunparse(parts)
198212

0 commit comments

Comments
 (0)
0