Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package python-urllib3 for openSUSE:Factory checked in at 2023-03-25 18:54:04 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/python-urllib3 (Old) and /work/SRC/openSUSE:Factory/.python-urllib3.new.31432 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-urllib3" Sat Mar 25 18:54:04 2023 rev:55 rq:1073863 version:1.26.15 Changes: -------- --- /work/SRC/openSUSE:Factory/python-urllib3/python-urllib3.changes 2023-01-23 18:30:43.591603911 +0100 +++ /work/SRC/openSUSE:Factory/.python-urllib3.new.31432/python-urllib3.changes 2023-03-25 18:54:05.722268429 +0100 @@ -1,0 +2,9 @@ +Tue Mar 14 22:46:12 UTC 2023 - Dirk Müller <[email protected]> + +- update to 1.26.15: + * Fix socket timeout value when ``HTTPConnection`` is reused + * Remove "!" character from the unreserved characters in IPv6 + Zone ID parsing + * Fix IDNA handling of '<80>' byte + +------------------------------------------------------------------- Old: ---- urllib3-1.26.14.tar.gz New: ---- urllib3-1.26.15.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python-urllib3.spec ++++++ --- /var/tmp/diff_new_pack.uGsb8X/_old 2023-03-25 18:54:06.514272570 +0100 +++ /var/tmp/diff_new_pack.uGsb8X/_new 2023-03-25 18:54:06.518272591 +0100 @@ -25,7 +25,7 @@ %bcond_with test %endif Name: python-urllib3%{psuffix} -Version: 1.26.14 +Version: 1.26.15 Release: 0 Summary: HTTP library with thread-safe connection pooling, file post, and more License: MIT ++++++ urllib3-1.26.14.tar.gz -> urllib3-1.26.15.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/urllib3-1.26.14/CHANGES.rst new/urllib3-1.26.15/CHANGES.rst --- old/urllib3-1.26.14/CHANGES.rst 2023-01-11 14:00:25.000000000 +0100 +++ new/urllib3-1.26.15/CHANGES.rst 2023-03-11 00:57:45.000000000 +0100 @@ -1,6 +1,14 @@ Changes ======= +1.26.15 (2023-03-10) +-------------------- + +* Fix socket timeout value when ``HTTPConnection`` is reused (`#2645 <https://github.com/urllib3/urllib3/issues/2645>`__) +* Remove "!" character from the unreserved characters in IPv6 Zone ID parsing + (`#2899 <https://github.com/urllib3/urllib3/issues/2899>`__) +* Fix IDNA handling of '\x80' byte (`#2901 <https://github.com/urllib3/urllib3/issues/2901>`__) + 1.26.14 (2023-01-11) -------------------- diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/urllib3-1.26.14/PKG-INFO new/urllib3-1.26.15/PKG-INFO --- old/urllib3-1.26.14/PKG-INFO 2023-01-11 14:00:39.975178700 +0100 +++ new/urllib3-1.26.15/PKG-INFO 2023-03-11 00:57:54.565305700 +0100 @@ -1,6 +1,6 @@ Metadata-Version: 2.1 Name: urllib3 -Version: 1.26.14 +Version: 1.26.15 Summary: HTTP library with thread-safe connection pooling, file post, and more. Home-page: https://urllib3.readthedocs.io/ Author: Andrey Petrov @@ -144,6 +144,14 @@ Changes ======= +1.26.15 (2023-03-10) +-------------------- + +* Fix socket timeout value when ``HTTPConnection`` is reused (`#2645 <https://github.com/urllib3/urllib3/issues/2645>`__) +* Remove "!" character from the unreserved characters in IPv6 Zone ID parsing + (`#2899 <https://github.com/urllib3/urllib3/issues/2899>`__) +* Fix IDNA handling of '\x80' byte (`#2901 <https://github.com/urllib3/urllib3/issues/2901>`__) + 1.26.14 (2023-01-11) -------------------- diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/urllib3-1.26.14/src/urllib3/_version.py new/urllib3-1.26.15/src/urllib3/_version.py --- old/urllib3-1.26.14/src/urllib3/_version.py 2023-01-11 14:00:25.000000000 +0100 +++ new/urllib3-1.26.15/src/urllib3/_version.py 2023-03-11 00:57:45.000000000 +0100 @@ -1,2 +1,2 @@ # This file is protected via CODEOWNERS -__version__ = "1.26.14" +__version__ = "1.26.15" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/urllib3-1.26.14/src/urllib3/connection.py new/urllib3-1.26.15/src/urllib3/connection.py --- old/urllib3-1.26.14/src/urllib3/connection.py 2023-01-11 14:00:25.000000000 +0100 +++ new/urllib3-1.26.15/src/urllib3/connection.py 2023-03-11 00:57:45.000000000 +0100 @@ -229,6 +229,11 @@ ) def request(self, method, url, body=None, headers=None): + # Update the inner socket's timeout value to send the request. + # This only triggers if the connection is re-used. + if getattr(self, "sock", None) is not None: + self.sock.settimeout(self.timeout) + if headers is None: headers = {} else: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/urllib3-1.26.14/src/urllib3/connectionpool.py new/urllib3-1.26.15/src/urllib3/connectionpool.py --- old/urllib3-1.26.14/src/urllib3/connectionpool.py 2023-01-11 14:00:25.000000000 +0100 +++ new/urllib3-1.26.15/src/urllib3/connectionpool.py 2023-03-11 00:57:45.000000000 +0100 @@ -379,7 +379,7 @@ timeout_obj = self._get_timeout(timeout) timeout_obj.start_connect() - conn.timeout = timeout_obj.connect_timeout + conn.timeout = Timeout.resolve_default_timeout(timeout_obj.connect_timeout) # Trigger any extra validation we need to do. try: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/urllib3-1.26.14/src/urllib3/util/timeout.py new/urllib3-1.26.15/src/urllib3/util/timeout.py --- old/urllib3-1.26.14/src/urllib3/util/timeout.py 2023-01-11 14:00:25.000000000 +0100 +++ new/urllib3-1.26.15/src/urllib3/util/timeout.py 2023-03-11 00:57:45.000000000 +0100 @@ -2,9 +2,8 @@ import time -# The default socket timeout, used by httplib to indicate that no timeout was -# specified by the user -from socket import _GLOBAL_DEFAULT_TIMEOUT +# The default socket timeout, used by httplib to indicate that no timeout was; specified by the user +from socket import _GLOBAL_DEFAULT_TIMEOUT, getdefaulttimeout from ..exceptions import TimeoutStateError @@ -117,6 +116,10 @@ __str__ = __repr__ @classmethod + def resolve_default_timeout(cls, timeout): + return getdefaulttimeout() if timeout is cls.DEFAULT_TIMEOUT else timeout + + @classmethod def _validate_timeout(cls, value, name): """Check that a timeout attribute is valid. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/urllib3-1.26.14/src/urllib3/util/url.py new/urllib3-1.26.15/src/urllib3/util/url.py --- old/urllib3-1.26.14/src/urllib3/util/url.py 2023-01-11 14:00:25.000000000 +0100 +++ new/urllib3-1.26.15/src/urllib3/util/url.py 2023-03-11 00:57:45.000000000 +0100 @@ -50,7 +50,7 @@ "(?:(?:%(hex)s:){0,6}%(hex)s)?::", ] -UNRESERVED_PAT = r"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789._!\-~" +UNRESERVED_PAT = r"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789._\-~" IPV6_PAT = "(?:" + "|".join([x % _subs for x in _variations]) + ")" ZONE_ID_PAT = "(?:%25|%)(?:[" + UNRESERVED_PAT + "]|%[a-fA-F0-9]{2})+" IPV6_ADDRZ_PAT = r"\[" + IPV6_PAT + r"(?:" + ZONE_ID_PAT + r")?\]" @@ -303,7 +303,7 @@ def _idna_encode(name): - if name and any([ord(x) > 128 for x in name]): + if name and any(ord(x) >= 128 for x in name): try: import idna except ImportError: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/urllib3-1.26.14/src/urllib3.egg-info/PKG-INFO new/urllib3-1.26.15/src/urllib3.egg-info/PKG-INFO --- old/urllib3-1.26.14/src/urllib3.egg-info/PKG-INFO 2023-01-11 14:00:39.000000000 +0100 +++ new/urllib3-1.26.15/src/urllib3.egg-info/PKG-INFO 2023-03-11 00:57:54.000000000 +0100 @@ -1,6 +1,6 @@ Metadata-Version: 2.1 Name: urllib3 -Version: 1.26.14 +Version: 1.26.15 Summary: HTTP library with thread-safe connection pooling, file post, and more. Home-page: https://urllib3.readthedocs.io/ Author: Andrey Petrov @@ -144,6 +144,14 @@ Changes ======= +1.26.15 (2023-03-10) +-------------------- + +* Fix socket timeout value when ``HTTPConnection`` is reused (`#2645 <https://github.com/urllib3/urllib3/issues/2645>`__) +* Remove "!" character from the unreserved characters in IPv6 Zone ID parsing + (`#2899 <https://github.com/urllib3/urllib3/issues/2899>`__) +* Fix IDNA handling of '\x80' byte (`#2901 <https://github.com/urllib3/urllib3/issues/2901>`__) + 1.26.14 (2023-01-11) -------------------- diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/urllib3-1.26.14/test/with_dummyserver/test_connectionpool.py new/urllib3-1.26.15/test/with_dummyserver/test_connectionpool.py --- old/urllib3-1.26.14/test/with_dummyserver/test_connectionpool.py 2023-01-11 14:00:25.000000000 +0100 +++ new/urllib3-1.26.15/test/with_dummyserver/test_connectionpool.py 2023-03-11 00:57:45.000000000 +0100 @@ -378,6 +378,59 @@ with HTTPConnectionPool(self.host, self.port, timeout=timeout) as pool: pool.request("GET", "/") + socket_timeout_reuse_testdata = pytest.mark.parametrize( + ["timeout", "expect_settimeout_calls"], + [ + (1, (1, 1)), + (None, (None, None)), + (Timeout(read=4), (None, 4)), + (Timeout(read=4, connect=5), (5, 4)), + (Timeout(connect=6), (6, None)), + ], + ) + + @socket_timeout_reuse_testdata + def test_socket_timeout_updated_on_reuse_constructor( + self, timeout, expect_settimeout_calls + ): + with HTTPConnectionPool(self.host, self.port, timeout=timeout) as pool: + # Make a request to create a new connection. + pool.urlopen("GET", "/") + + # Grab the connection and mock the inner socket. + assert pool.pool is not None + conn = pool.pool.get_nowait() + conn_sock = mock.Mock(wraps=conn.sock) + conn.sock = conn_sock + pool._put_conn(conn) + + # Assert that sock.settimeout() is called with the new connect timeout, then the read timeout. + pool.urlopen("GET", "/", timeout=timeout) + conn_sock.settimeout.assert_has_calls( + [mock.call(x) for x in expect_settimeout_calls] + ) + + @socket_timeout_reuse_testdata + def test_socket_timeout_updated_on_reuse_parameter( + self, timeout, expect_settimeout_calls + ): + with HTTPConnectionPool(self.host, self.port) as pool: + # Make a request to create a new connection. + pool.urlopen("GET", "/", timeout=LONG_TIMEOUT) + + # Grab the connection and mock the inner socket. + assert pool.pool is not None + conn = pool.pool.get_nowait() + conn_sock = mock.Mock(wraps=conn.sock) + conn.sock = conn_sock + pool._put_conn(conn) + + # Assert that sock.settimeout() is called with the new connect timeout, then the read timeout. + pool.urlopen("GET", "/", timeout=timeout) + conn_sock.settimeout.assert_has_calls( + [mock.call(x) for x in expect_settimeout_calls] + ) + def test_tunnel(self): # note the actual httplib.py has no tests for this functionality timeout = Timeout(total=None) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/urllib3-1.26.14/test/with_dummyserver/test_socketlevel.py new/urllib3-1.26.15/test/with_dummyserver/test_socketlevel.py --- old/urllib3-1.26.14/test/with_dummyserver/test_socketlevel.py 2023-01-11 14:00:25.000000000 +0100 +++ new/urllib3-1.26.15/test/with_dummyserver/test_socketlevel.py 2023-03-11 00:57:45.000000000 +0100 @@ -776,7 +776,7 @@ # leaking it. Because we don't want to hang this thread, we # actually use select.select to confirm that a new request is # coming in: this lets us time the thread out. - rlist, _, _ = select.select([listener], [], [], 1) + rlist, _, _ = select.select([listener], [], []) assert rlist new_sock = listener.accept()[0] @@ -885,7 +885,7 @@ # Expect a new request. Because we don't want to hang this thread, # we actually use select.select to confirm that a new request is # coming in: this lets us time the thread out. - rlist, _, _ = select.select([listener], [], [], 5) + rlist, _, _ = select.select([listener], [], []) assert rlist sock = listener.accept()[0] consume_socket(sock)
