]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
bpo-35116, urllib.parse: Document the new max_num_fields parameter (GH-10248)
authormatthewbelisle-wf <matthew.belisle@workiva.com>
Tue, 30 Oct 2018 21:15:18 +0000 (16:15 -0500)
committerVictor Stinner <vstinner@redhat.com>
Tue, 30 Oct 2018 21:15:18 +0000 (22:15 +0100)
Doc/library/urllib.parse.rst

index 1cc69e62e63318e1ffb03564573f5049dee955d6..d991254d5ca1e8a89cdcfada194b4d963fef59c4 100644 (file)
@@ -134,7 +134,7 @@ or on combining URL components into a URL string.
       returning :const:`None`.
 
 
-.. function:: parse_qs(qs, keep_blank_values=False, strict_parsing=False, encoding='utf-8', errors='replace')
+.. function:: parse_qs(qs, keep_blank_values=False, strict_parsing=False, encoding='utf-8', errors='replace', max_num_fields=None)
 
    Parse a query string given as a string argument (data of type
    :mimetype:`application/x-www-form-urlencoded`).  Data are returned as a
@@ -155,6 +155,10 @@ or on combining URL components into a URL string.
    percent-encoded sequences into Unicode characters, as accepted by the
    :meth:`bytes.decode` method.
 
+   The optional argument *max_num_fields* is the maximum number of fields to
+   read. If set, then throws a :exc:`ValueError` if there are more than
+   *max_num_fields* fields read.
+
    Use the :func:`urllib.parse.urlencode` function (with the ``doseq``
    parameter set to ``True``) to convert such dictionaries into query
    strings.
@@ -163,8 +167,11 @@ or on combining URL components into a URL string.
    .. versionchanged:: 3.2
       Add *encoding* and *errors* parameters.
 
+   .. versionchanged:: 3.6.8
+      Added *max_num_fields* parameter.
+
 
-.. function:: parse_qsl(qs, keep_blank_values=False, strict_parsing=False, encoding='utf-8', errors='replace')
+.. function:: parse_qsl(qs, keep_blank_values=False, strict_parsing=False, encoding='utf-8', errors='replace', max_num_fields=None)
 
    Parse a query string given as a string argument (data of type
    :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.
    percent-encoded sequences into Unicode characters, as accepted by the
    :meth:`bytes.decode` method.
 
+   The optional argument *max_num_fields* is the maximum number of fields to
+   read. If set, then throws a :exc:`ValueError` if there are more than
+   *max_num_fields* fields read.
+
    Use the :func:`urllib.parse.urlencode` function to convert such lists of pairs into
    query strings.
 
    .. versionchanged:: 3.2
       Add *encoding* and *errors* parameters.
 
+   .. versionchanged:: 3.6.8
+      Added *max_num_fields* parameter.
+
 
 .. function:: urlunparse(parts)