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 2023-07-06 18:27:46 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/python-yarl (Old) and /work/SRC/openSUSE:Factory/.python-yarl.new.23466 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-yarl" Thu Jul 6 18:27:46 2023 rev:25 rq:1096862 version:1.9.2 Changes: -------- --- /work/SRC/openSUSE:Factory/python-yarl/python-yarl.changes 2023-04-27 19:59:04.897271987 +0200 +++ /work/SRC/openSUSE:Factory/.python-yarl.new.23466/python-yarl.changes 2023-07-06 18:27:47.830823177 +0200 @@ -1,0 +2,6 @@ +Tue Jul 4 21:47:32 UTC 2023 - Matej Cepl <[email protected]> + +- Add 882-sq_bracket_in_URL_netloc.patch fixing handling of + square bracket handling in URL netloc (gh#aio-libs/yarl#876). + +------------------------------------------------------------------- New: ---- 882-sq_bracket_in_URL_netloc.patch ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python-yarl.spec ++++++ --- /var/tmp/diff_new_pack.QeIGgA/_old 2023-07-06 18:27:48.550827598 +0200 +++ /var/tmp/diff_new_pack.QeIGgA/_new 2023-07-06 18:27:48.554827622 +0200 @@ -24,13 +24,17 @@ License: Apache-2.0 URL: https://github.com/aio-libs/yarl/ Source: https://files.pythonhosted.org/packages/source/y/yarl/yarl-%{version}.tar.gz +# PATCH-FIX-UPSTREAM 882-sq_bracket_in_URL_netloc.patch gh#aio-libs/yarl#876 [email protected] +# Correct square bracket handling in URL netloc +Patch0: 882-sq_bracket_in_URL_netloc.patch BuildRequires: %{python_module Cython} BuildRequires: %{python_module devel >= 3.7} BuildRequires: %{python_module idna >= 2.0} # test requirements BuildRequires: %{python_module multidict >= 4.0} +BuildRequires: %{python_module pip} BuildRequires: %{python_module pytest} -BuildRequires: %{python_module setuptools} +BuildRequires: %{python_module wheel} BuildRequires: fdupes BuildRequires: python-rpm-macros Requires: python-idna >= 2.0 @@ -46,10 +50,10 @@ %build export CFLAGS="%{optflags} -Wno-return-type" -%python_build +%pyproject_wheel %install -%python_install +%pyproject_install %python_expand %fdupes %{buildroot}%{$python_sitearch} %check ++++++ 882-sq_bracket_in_URL_netloc.patch ++++++ >From 5c977b52a33bf58f016e5968934c3fcb8b49b239 Mon Sep 17 00:00:00 2001 From: Martijn Pieters <[email protected]> Date: Tue, 6 Jun 2023 17:38:47 +0100 Subject: [PATCH] Correct square bracket handling in URL netloc - The human representation of usernames and passwords should percent- encode square brackets. - Clean up the test suite to remove tests that use invalid hostnames (square brackets in a host name must only be used for IPv6 addresses). - Rename the remaining test using IPvFuture address syntax to make this explicit. - Drop a test for IPv6 addresses with a zone id; zone id support is controversial and expilictly excluded from the WHATWG URL standard. Zone ids *without percent characters in their name* continue to work as long as urllib.parse.urlsplit() accepts them but this is not something that yarl.URL() needs to support explicitly. --- CHANGES/876.bugfix.rst | 1 + tests/test_url.py | 10 ++-------- tests/test_url_parsing.py | 28 ++-------------------------- yarl/_url.py | 4 ++-- 4 files changed, 7 insertions(+), 36 deletions(-) create mode 100644 CHANGES/876.bugfix.rst --- /dev/null +++ b/CHANGES/876.bugfix.rst @@ -0,0 +1 @@ +Fixed the human representation of URLs with square brackets in usernames and passwords. --- a/tests/test_url.py +++ b/tests/test_url.py @@ -235,12 +235,6 @@ def test_compressed_ipv6(): assert url.host == url.raw_host -def test_ipv6_zone(): - url = URL("http://[fe80::822a:a8ff:fe49:470c%ÑеÑÑ%42]:123") - assert url.raw_host == "fe80::822a:a8ff:fe49:470c%ÑеÑÑ%42" - assert url.host == url.raw_host - - def test_ipv4_zone(): # I'm unsure if it is correct. url = URL("http://1.2.3.4%ÑеÑÑ%42:123") @@ -1629,8 +1623,8 @@ def test_human_repr_delimiters(): s = url.human_repr() assert URL(s) == url assert ( - s == "http:// !\"%23$%25&'()*+,-.%2F%3A;<=>%3F%40[\\]^_`{|}~" - ": !\"%23$%25&'()*+,-.%2F%3A;<=>%3F%40[\\]^_`{|}~" + s == "http:// !\"%23$%25&'()*+,-.%2F%3A;<=>%3F%40%5B\\%5D^_`{|}~" + ": !\"%23$%25&'()*+,-.%2F%3A;<=>%3F%40%5B\\%5D^_`{|}~" "@Ñ Ð¾ÑÑ.домен:8080" "/ !\"%23$%25&'()*+,-./:;<=>%3F@[\\]^_`{|}~" "? !\"%23$%25%26'()*%2B,-./:%3B<%3D>?@[\\]^_`{|}~" --- a/tests/test_url_parsing.py +++ b/tests/test_url_parsing.py @@ -178,14 +178,6 @@ class TestHost: assert u.query_string == "" assert u.fragment == "" - def test_masked_ipv4(self): - u = URL("//[127.0.0.1]/") - assert u.scheme == "" - assert u.host == "127.0.0.1" - assert u.path == "/" - assert u.query_string == "" - assert u.fragment == "" - def test_ipv6(self): u = URL("//[::1]/") assert u.scheme == "" @@ -194,15 +186,7 @@ class TestHost: assert u.query_string == "" assert u.fragment == "" - def test_strange_ip(self): - u = URL("//[-1]/") - assert u.scheme == "" - assert u.host == "-1" - assert u.path == "/" - assert u.query_string == "" - assert u.fragment == "" - - def test_strange_ip_2(self): + def test_ipvfuture_address(self): u = URL("//[v1.-1]/") assert u.scheme == "" assert u.host == "v1.-1" @@ -210,14 +194,6 @@ class TestHost: assert u.query_string == "" assert u.fragment == "" - def test_strange_ip_3(self): - u = URL("//v1.[::1]/") - assert u.scheme == "" - assert u.host == "::1" - assert u.path == "/" - assert u.query_string == "" - assert u.fragment == "" - class TestPort: def test_canonical(self): @@ -320,7 +296,7 @@ class TestUserInfo: assert u.fragment == "" def test_weird_user3(self): - u = URL("//[some]@host") + u = URL("//%5Bsome%5D@host") assert u.scheme == "" assert u.user == "[some]" assert u.password is None --- a/yarl/_url.py +++ b/yarl/_url.py @@ -1117,8 +1117,8 @@ class URL: def human_repr(self): """Return decoded human readable string for URL representation.""" - user = _human_quote(self.user, "#/:?@") - password = _human_quote(self.password, "#/:?@") + user = _human_quote(self.user, "#/:?@[]") + password = _human_quote(self.password, "#/:?@[]") host = self.host if host: host = self._encode_host(self.host, human=True)
