Annotation of pkgsrc/lang/python27/patches/patch-Doc_library_urlparse.rst, revision 1.2

1.2     ! gutterid    1: $NetBSD: patch-Doc_library_urlparse.rst,v 1.1 2021/10/10 03:00:59 gutteridge Exp $
1.1       gutterid    2: 
                      3: Fix CVE-2021-23336: Add `separator` argument to parse_qs; warn with default
                      4: Via Fedora:
                      5: https://src.fedoraproject.org/rpms/python2.7/blob/rawhide/f/00359-CVE-2021-23336.patch
                      6: 
1.2     ! gutterid    7: Fix CVE-2022-0391: urlparse does not sanitize URLs containing ASCII newline and tabs
        !             8: Via Fedora:
        !             9: https://src.fedoraproject.org/rpms/python2.7/raw/40dd05e5d77dbfa81777c9f84b704bc2239bf710/f/00377-CVE-2022-0391.patch
        !            10: 
1.1       gutterid   11: --- Doc/library/urlparse.rst.orig      2020-04-19 21:13:39.000000000 +0000
                     12: +++ Doc/library/urlparse.rst
1.2     ! gutterid   13: @@ -125,6 +125,9 @@ The :mod:`urlparse` module defines the f
        !            14:     decomposed before parsing, or is not a Unicode string, no error will be
        !            15:     raised.
        !            16:  
        !            17: +   Following the `WHATWG spec`_ that updates RFC 3986, ASCII newline
        !            18: +   ``\n``, ``\r`` and tab ``\t`` characters are stripped from the URL.
        !            19: +
        !            20:     .. versionchanged:: 2.5
        !            21:        Added attributes to return value.
        !            22:  
        !            23: @@ -136,7 +139,7 @@ The :mod:`urlparse` module defines the f
1.1       gutterid   24:        now raise :exc:`ValueError`.
                     25:  
                     26:  
                     27: -.. function:: parse_qs(qs[, keep_blank_values[, strict_parsing[, max_num_fields]]])
                     28: +.. function:: parse_qs(qs[, keep_blank_values[, strict_parsing[, max_num_fields[, separator]]]])
                     29:  
                     30:     Parse a query string given as a string argument (data of type
                     31:     :mimetype:`application/x-www-form-urlencoded`).  Data are returned as a
1.2     ! gutterid   32: @@ -157,6 +160,15 @@ The :mod:`urlparse` module defines the f
1.1       gutterid   33:     read. If set, then throws a :exc:`ValueError` if there are more than
                     34:     *max_num_fields* fields read.
                     35:  
                     36: +   The optional argument *separator* is the symbol to use for separating the
                     37: +   query arguments. It is recommended to set it to ``'&'`` or ``';'``.
                     38: +   It defaults to ``'&'``; a warning is raised if this default is used.
                     39: +   This default may be changed with the following environment variable settings:
                     40: +
                     41: +   - ``PYTHON_URLLIB_QS_SEPARATOR='&'``: use only ``&`` as separator, without warning (as in Python 3.6.13+ or 3.10)
                     42: +   - ``PYTHON_URLLIB_QS_SEPARATOR=';'``: use only ``;`` as separator
                     43: +   - ``PYTHON_URLLIB_QS_SEPARATOR=legacy``: use both ``&`` and ``;`` (as in previous versions of Python)
                     44: +
                     45:     Use the :func:`urllib.urlencode` function to convert such dictionaries into
                     46:     query strings.
                     47:  
1.2     ! gutterid   48: @@ -186,6 +198,9 @@ The :mod:`urlparse` module defines the f
1.1       gutterid   49:     read. If set, then throws a :exc:`ValueError` if there are more than
                     50:     *max_num_fields* fields read.
                     51:  
                     52: +   The optional argument *separator* is the symbol to use for separating the
                     53: +   query arguments. It works as in :py:func:`parse_qs`.
                     54: +
                     55:     Use the :func:`urllib.urlencode` function to convert such lists of pairs into
                     56:     query strings.
                     57:  
1.2     ! gutterid   58: @@ -195,6 +210,7 @@ The :mod:`urlparse` module defines the f
1.1       gutterid   59:     .. versionchanged:: 2.7.16
                     60:        Added *max_num_fields* parameter.
                     61:  
                     62: +
                     63:  .. function:: urlunparse(parts)
                     64:  
                     65:     Construct a URL from a tuple as returned by ``urlparse()``. The *parts* argument
1.2     ! gutterid   66: @@ -308,6 +324,10 @@ The :mod:`urlparse` module defines the f
        !            67:  
        !            68:  .. seealso::
        !            69:  
        !            70: +   `WHATWG`_ -  URL Living standard
        !            71: +      Working Group for the URL Standard that defines URLs, domains, IP addresses, the
        !            72: +      application/x-www-form-urlencoded format, and their API.
        !            73: +
        !            74:     :rfc:`3986` - Uniform Resource Identifiers
        !            75:        This is the current standard (STD66). Any changes to urlparse module
        !            76:        should conform to this. Certain deviations could be observed, which are
        !            77: @@ -332,6 +352,7 @@ The :mod:`urlparse` module defines the f
        !            78:     :rfc:`1738` - Uniform Resource Locators (URL)
        !            79:        This specifies the formal syntax and semantics of absolute URLs.
        !            80:  
        !            81: +.. _WHATWG: https://url.spec.whatwg.org/
        !            82:  
        !            83:  .. _urlparse-result-object:
        !            84:  

CVSweb <webmaster@jp.NetBSD.org>