8000 Adding Doc/library entries for max_num_fields · python/cpython@90ab0d5 · GitHub
[go: up one dir, main page]

Skip to content

Commit 90ab0d5

Browse files
Adding Doc/library entries for max_num_fields
1 parent f8966df commit 90ab0d5

File tree

2 files changed

+16
-4
lines changed

2 files changed

+16
-4
lines changed

Doc/library/cgi.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -292,12 +292,12 @@ algorithms implemented in this module in other circumstances.
292292
passed to :func:`urlparse.parse_qs` unchanged.
293293

294294

295-
.. function:: parse_qs(qs[, keep_blank_values[, strict_parsing]])
295+
.. function:: parse_qs(qs[, keep_blank_values[, strict_parsing[, max_num_fields]]])
296296

297297
This function is deprecated in this module. Use :func:`urlparse.parse_qs`
298298
instead. It is maintained here only for backward compatibility.
299299

300-
.. function:: parse_qsl(qs[, keep_blank_values[, strict_parsing]])
300+
.. function:: parse_qsl(qs[, keep_blank_values[, strict_parsing[, max_num_fields]]])
301301

302302
This function is deprecated in this module. Use :func:`urlparse.parse_qsl`
303303
instead. It is maintained here only for backward compatibility.

Doc/library/urlparse.rst

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ The :mod:`urlparse` module defines the following functions:
126126
Added IPv6 URL parsing capabilities.
127127

128128

129-
.. function:: parse_qs(qs[, keep_blank_values[, strict_parsing]])
129+
.. function:: parse_qs(qs[, keep_blank_values[, strict_parsing[, max_num_fields]]])
130130

131131
Parse a query string given as a string argument (data of type
132132
:mimetype:`application/x-www-form-urlencoded`). Data are returned as a
@@ -143,14 +143,20 @@ The :mod:`urlparse` module defines the following functions:
143143
parsing errors. If false (the default), errors are silently ignored. If true,
144144
errors raise a :exc:`ValueError` exception.
145145

146+
The optional argument *max_num_fields* is a flag for the maximum number of
147+
fields to read. If set, then throws a :exc:`ValueError` if there are more
148+
than *max_num_fields* fields read. Default is *None*.
149+
146150
Use the :func:`urllib.urlencode` function to convert such dictionaries into
147151
query strings.
148152

149153
.. versionadded:: 2.6
150154
Copied from the :mod:`cgi` module.
151155

156+
.. versionchanged:: 2.7.16
157+
Added *max_num_fields* param.
152158

153-
.. function:: parse_qsl(qs[, keep_blank_values[, strict_parsing]])
159+
.. function:: parse_qsl(qs[, keep_blank_values[, strict_parsing[, max_num_fields]]])
154160

155161
Parse a query string given as a string argument (data of type
156162
:mimetype:`application/x-www-form-urlencoded`). Data are returned as a list of
@@ -166,12 +172,18 @@ The :mod:`urlparse` module defines the following functions:
166172
parsing errors. If false (the default), errors are silently ignored. If true,
167173
errors raise a :exc:`ValueError` exception.
168174

175+
The optional argument *max_num_fields* is a flag for the maximum number of
176+
fields to read. If set, then throws a :exc:`ValueError` if there are more
177+
than *max_num_fields* fields read. Default is *None*.
178+
169179
Use the :func:`urllib.urlencode` function to convert such lists of pairs into
170180
query strings.
171181

172182
.. versionadded:: 2.6
173183
Copied from the :mod:`cgi` module.
174184

185+
.. versionchanged:: 2.7.16
186+
Added *max_num_fields* param.
175187

176188
.. function:: urlunparse(parts)
177189

0 commit comments

Comments
 (0)
0