Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package python-yarl for openSUSE:Factory checked in at 2021-03-02 14:43:01 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/python-yarl (Old) and /work/SRC/openSUSE:Factory/.python-yarl.new.2378 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-yarl" Tue Mar 2 14:43:01 2021 rev:16 rq:874658 version:1.6.3 Changes: -------- --- /work/SRC/openSUSE:Factory/python-yarl/python-yarl.changes 2020-12-23 14:18:51.465572393 +0100 +++ /work/SRC/openSUSE:Factory/.python-yarl.new.2378/python-yarl.changes 2021-03-02 15:30:10.785962375 +0100 @@ -1,0 +2,7 @@ +Tue Feb 23 17:02:42 UTC 2021 - Matej Cepl <mc...@suse.com> + +- Add tests_overcome_bpo42967.patch to over effects of bpo#42967, + which forbade mixing amps and semicolons in query strings as + separators. + +------------------------------------------------------------------- New: ---- tests_overcome_bpo42967.patch ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python-yarl.spec ++++++ --- /var/tmp/diff_new_pack.cmHXsr/_old 2021-03-02 15:30:11.357962749 +0100 +++ /var/tmp/diff_new_pack.cmHXsr/_new 2021-03-02 15:30:11.357962749 +0100 @@ -1,7 +1,7 @@ # # spec file for package python-yarl # -# Copyright (c) 2020 SUSE LLC +# Copyright (c) 2021 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -26,6 +26,10 @@ Group: Development/Languages/Python URL: https://github.com/aio-libs/yarl/ Source: https://files.pythonhosted.org/packages/source/y/yarl/yarl-%{version}.tar.gz +# PATCH-FIX-UPSTREAM tests_overcome_bpo42967.patch bsc#[0-9]+ mc...@suse.com +# Overcome effects of bpo#42967, which forbade mixing amps and +# semicolons in query strings as separators. +Patch0: tests_overcome_bpo42967.patch BuildRequires: %{python_module Cython} BuildRequires: %{python_module devel} BuildRequires: %{python_module idna >= 2.0} @@ -46,7 +50,7 @@ The module provides a URL class for url parsing and changing. %prep -%setup -q -n yarl-%{version} +%autosetup -p1 -n yarl-%{version} %build export CFLAGS="%{optflags}" ++++++ tests_overcome_bpo42967.patch ++++++ --- a/yarl/_url.py +++ b/yarl/_url.py @@ -1,4 +1,5 @@ import functools +import inspect import sys import warnings from collections.abc import Mapping, Sequence @@ -142,7 +143,7 @@ class URL: _PATH_UNQUOTER = _Unquoter(unsafe="+") _QS_UNQUOTER = _Unquoter(qs=True) - def __new__(cls, val="", *, encoded=False, strict=None): + def __new__(cls, val="", *, encoded=False, strict=None, separator='&'): if strict is not None: # pragma: no cover warnings.warn("strict parameter is ignored") if type(val) is cls: @@ -157,6 +158,8 @@ class URL: else: raise TypeError("Constructor parameter should be str") + cls.qs_sep = separator + if not encoded: if not val[1]: # netloc netloc = "" @@ -551,7 +554,12 @@ class URL: Empty value if URL has no query part. """ - ret = MultiDict(parse_qsl(self.raw_query_string, keep_blank_values=True)) + if 'separator' in inspect.signature(parse_qsl).parameters: + qs_dict = parse_qsl(self.raw_query_string, + keep_blank_values=True, separator=self.qs_sep) + else: + qs_dict = parse_qsl(self.raw_query_string, keep_blank_values=True) + ret = MultiDict(qs_dict) return MultiDictProxy(ret) @property @@ -988,7 +996,12 @@ class URL: def update_query(self, *args, **kwargs): """Return a new URL with query part updated.""" s = self._get_str_query(*args, **kwargs) - new_query = MultiDict(parse_qsl(s, keep_blank_values=True)) + if 'separator' in inspect.signature(parse_qsl).parameters: + qs_dict = parse_qsl(s, keep_blank_values=True, + separator=self.qs_sep) + else: + qs_dict = parse_qsl(s, keep_blank_values=True) + new_query = MultiDict(qs_dict) query = MultiDict(self.query) query.update(new_query) --- a/tests/test_url_query.py +++ b/tests/test_url_query.py @@ -63,7 +63,7 @@ def test_ampersand_as_value(): def test_semicolon_as_separator(): - u = URL("http://127.0.0.1/?a=1;b=2") + u = URL("http://127.0.0.1/?a=1;b=2", separator=';') assert len(u.query) == 2