Source: python-urllib3
Version: 2.2.3-4
Severity: serious
Justification: FTBFS
Tags: trixie sid ftbfs
User: [email protected]
Usertags: ftbfs-20241222 ftbfs-trixie

Hi,

During a rebuild of all packages in sid, your package failed to build
on amd64.


Relevant part (hopefully):
> make[1]: Entering directory '/<<PKGBUILDDIR>>'
> PYTHONPATH=/<<PKGBUILDDIR>>/debian/vendor dh_auto_test
> I: pybuild base:311: cd 
> /<<PKGBUILDDIR>>/.pybuild/cpython3_3.13_urllib3/build; python3.13 -m pytest 
> -k "not requires_network and not test_recent_date"
> ============================= test session starts 
> ==============================
> platform linux -- Python 3.13.1, pytest-8.3.4, pluggy-1.5.0
> rootdir: /<<PKGBUILDDIR>>/.pybuild/cpython3_3.13_urllib3/build
> configfile: pyproject.toml
> plugins: timeout-2.3.1, typeguard-4.4.1, anyio-4.6.2
> collected 2141 items / 41 deselected / 1 skipped / 2100 selected
> 
> test/contrib/test_pyopenssl.py ......................................... [  
> 1%]
> ..........................ssssssssssssssssssssssssssssssssssssssssssssss [  
> 5%]
> ssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss [  
> 8%]
> ssss.............................................s......xs.............. [ 
> 12%]
> ..............................s.....s......xs...s....................... [ 
> 15%]
> ...........sssss....                                                     [ 
> 16%]
> test/contrib/test_pyopenssl_dependencies.py ..                           [ 
> 16%]
> test/contrib/test_socks.py .................F.                           [ 
> 17%]
> test/test_collections.py .............................................   [ 
> 19%]
> test/test_compatibility.py ..                                            [ 
> 19%]
> test/test_connection.py ................................................ [ 
> 22%]
> ........................................................................ [ 
> 25%]
> ........................................................................ [ 
> 29%]
> ........................................................................ [ 
> 32%]
> ..............                                                           [ 
> 33%]
> test/test_connectionpool.py ............................................ [ 
> 35%]
> ..............................                                           [ 
> 36%]
> test/test_exceptions.py ..............                                   [ 
> 37%]
> test/test_fields.py ....................                                 [ 
> 38%]
> test/test_filepost.py .........                                          [ 
> 38%]
> test/test_http2_connection.py ..................                         [ 
> 39%]
> test/test_no_ssl.py ..                                                   [ 
> 39%]
> test/test_poolmanager.py .....................................           [ 
> 41%]
> test/test_proxymanager.py ......                                         [ 
> 41%]
> test/test_queue_monkeypatch.py .                                         [ 
> 41%]
> test/test_response.py .........................................sssssssss [ 
> 44%]
> ssss.................................................................... [ 
> 47%]
> ........                                                                 [ 
> 47%]
> test/test_retry.py ..................................................... [ 
> 50%]
> ........                                                                 [ 
> 50%]
> test/test_ssl.py ...........................................             [ 
> 52%]
> test/test_ssltransport.py .................                              [ 
> 53%]
> test/test_util.py ...................................................... [ 
> 56%]
> ........................................................................ [ 
> 59%]
> ........................................................................ [ 
> 63%]
> .........................................s.ss..s.ss..................... [ 
> 66%]
> .................................................................        [ 
> 69%]
> test/test_wait.py .............                                          [ 
> 70%]
> test/with_dummyserver/test_chunked_transfer.py .......................   [ 
> 71%]
> test/with_dummyserver/test_connection.py ........                        [ 
> 71%]
> test/with_dummyserver/test_connectionpool.py ........................... [ 
> 73%]
> ........................................................................ [ 
> 76%]
> ....................                                                     [ 
> 77%]
> test/with_dummyserver/test_https.py ssssssssssssssssssssssssssssssssssss [ 
> 79%]
> ssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss [ 
> 82%]
> ssssssssss....................................................xs........ [ 
> 85%]
> ....................................s............xs...s...s..s.....ss... [ 
> 89%]
> ssss                                                                     [ 
> 89%]
> test/with_dummyserver/test_no_ssl.py ..                                  [ 
> 89%]
> test/with_dummyserver/test_poolmanager.py .............................. [ 
> 91%]
> .................s                                                       [ 
> 91%]
> test/with_dummyserver/test_proxy_poolmanager.py ........................ [ 
> 93%]
> .......s....s..s......                                                   [ 
> 94%]
> test/with_dummyserver/test_socketlevel.py .............................. [ 
> 95%]
> .................sssss.............................................s.s.s [ 
> 99%]
> .....................                                                    
> [100%]
> 
> =================================== FAILURES 
> ===================================
> _______________ TestSOCKS4Proxy.test_socks_with_invalid_username 
> _______________
> 
> self = <socks.socksocket [closed] fd=-1, family=2, type=1, proto=6>
> dest_pair = ('example.com', 80), catch_errors = None
> 
>     @set_self_blocking
>     def connect(self, dest_pair, catch_errors=None):
>         """
>         Connects to the specified destination through a proxy.
>         Uses the same API as socket's connect().
>         To select the proxy server, use set_proxy().
>     
>         dest_pair - 2-tuple of (IP/hostname, port).
>         """
>         if len(dest_pair) != 2 or dest_pair[0].startswith("["):
>             # Probably IPv6, not supported -- raise an error, and hope
>             # Happy Eyeballs (RFC6555) makes sure at least the IPv4
>             # connection works...
>             raise socket.error("PySocks doesn't support IPv6: %s"
>                                % str(dest_pair))
>     
>         dest_addr, dest_port = dest_pair
>     
>         if self.type == socket.SOCK_DGRAM:
>             if not self._proxyconn:
>                 self.bind(("", 0))
>             dest_addr = socket.gethostbyname(dest_addr)
>     
>             # If the host address is INADDR_ANY or similar, reset the peer
>             # address so that packets are received from any peer
>             if dest_addr == "0.0.0.0" and not dest_port:
>                 self.proxy_peername = None
>             else:
>                 self.proxy_peername = (dest_addr, dest_port)
>             return
>     
>         (proxy_type, proxy_addr, proxy_port, rdns, username,
>          password) = self.proxy
>     
>         # Do a minimal input check first
>         if (not isinstance(dest_pair, (list, tuple))
>                 or len(dest_pair) != 2
>                 or not dest_addr
>                 or not isinstance(dest_port, int)):
>             # Inputs failed, raise an error
>             raise GeneralProxyError(
>                 "Invalid destination-connection (host, port) pair")
>     
>         # We set the timeout here so that we don't hang in connection or 
> during
>         # negotiation.
>         super(socksocket, self).settimeout(self._timeout)
>     
>         if proxy_type is None:
>             # Treat like regular socket object
>             self.proxy_peername = dest_pair
>             super(socksocket, self).settimeout(self._timeout)
>             super(socksocket, self).connect((dest_addr, dest_port))
>             return
>     
>         proxy_addr = self._proxy_addr()
>     
>         try:
>             # Initial connection to proxy server.
> >           super(socksocket, self).connect(proxy_addr)
> E           ConnectionRefusedError: [Errno 111] Connection refused
> 
> /usr/lib/python3/dist-packages/socks.py:787: ConnectionRefusedError
> 
> During handling of the above exception, another exception occurred:
> 
> self = <urllib3.contrib.socks.SOCKSConnection object at 0x7f3afc1a6570>
> 
>     def _new_conn(self) -> socks.socksocket:
>         """
>         Establish a new connection via the SOCKS proxy.
>         """
>         extra_kw: dict[str, typing.Any] = {}
>         if self.source_address:
>             extra_kw["source_address"] = self.source_address
>     
>         if self.socket_options:
>             extra_kw["socket_options"] = self.socket_options
>     
>         try:
> >           conn = socks.create_connection(
>                 (self.host, self.port),
>                 proxy_type=self._socks_options["socks_version"],
>                 proxy_addr=self._socks_options["proxy_host"],
>                 proxy_port=self._socks_options["proxy_port"],
>                 proxy_username=self._socks_options["username"],
>                 proxy_password=self._socks_options["password"],
>                 proxy_rdns=self._socks_options["rdns"],
>                 timeout=self.timeout,
>                 **extra_kw,
>             )
> 
> urllib3/contrib/socks.py:110: 
> _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
> _ 
> /usr/lib/python3/dist-packages/socks.py:209: in create_connection
>     raise err
> /usr/lib/python3/dist-packages/socks.py:199: in create_connection
>     sock.connect((remote_host, remote_port))
> /usr/lib/python3/dist-packages/socks.py:47: in wrapper
>     return function(*args, **kwargs)
> _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
> _ 
> 
> self = <socks.socksocket [closed] fd=-1, family=2, type=1, proto=6>
> dest_pair = ('example.com', 80), catch_errors = None
> 
>     @set_self_blocking
>     def connect(self, dest_pair, catch_errors=None):
>         """
>         Connects to the specified destination through a proxy.
>         Uses the same API as socket's connect().
>         To select the proxy server, use set_proxy().
>     
>         dest_pair - 2-tuple of (IP/hostname, port).
>         """
>         if len(dest_pair) != 2 or dest_pair[0].startswith("["):
>             # Probably IPv6, not supported -- raise an error, and hope
>             # Happy Eyeballs (RFC6555) makes sure at least the IPv4
>             # connection works...
>             raise socket.error("PySocks doesn't support IPv6: %s"
>                                % str(dest_pair))
>     
>         dest_addr, dest_port = dest_pair
>     
>         if self.type == socket.SOCK_DGRAM:
>             if not self._proxyconn:
>                 self.bind(("", 0))
>             dest_addr = socket.gethostbyname(dest_addr)
>     
>             # If the host address is INADDR_ANY or similar, reset the peer
>             # address so that packets are received from any peer
>             if dest_addr == "0.0.0.0" and not dest_port:
>                 self.proxy_peername = None
>             else:
>                 self.proxy_peername = (dest_addr, dest_port)
>             return
>     
>         (proxy_type, proxy_addr, proxy_port, rdns, username,
>          password) = self.proxy
>     
>         # Do a minimal input check first
>         if (not isinstance(dest_pair, (list, tuple))
>                 or len(dest_pair) != 2
>                 or not dest_addr
>                 or not isinstance(dest_port, int)):
>             # Inputs failed, raise an error
>             raise GeneralProxyError(
>                 "Invalid destination-connection (host, port) pair")
>     
>         # We set the timeout here so that we don't hang in connection or 
> during
>         # negotiation.
>         super(socksocket, self).settimeout(self._timeout)
>     
>         if proxy_type is None:
>             # Treat like regular socket object
>             self.proxy_peername = dest_pair
>             super(socksocket, self).settimeout(self._timeout)
>             super(socksocket, self).connect((dest_addr, dest_port))
>             return
>     
>         proxy_addr = self._proxy_addr()
>     
>         try:
>             # Initial connection to proxy server.
>             super(socksocket, self).connect(proxy_addr)
>     
>         except socket.error as error:
>             # Error while connecting to proxy
>             self.close()
>             if not catch_errors:
>                 proxy_addr, proxy_port = proxy_addr
>                 proxy_server = "{}:{}".format(proxy_addr, proxy_port)
>                 printable_type = PRINTABLE_PROXY_TYPES[proxy_type]
>     
>                 msg = "Error connecting to {} proxy {}".format(printable_type,
>                                                                     
> proxy_server)
>                 log.debug("%s due to: %s", msg, error)
> >               raise ProxyConnectionError(msg, error)
> E               socks.ProxyConnectionError: Error connecting to SOCKS4 proxy 
> localhost:38485: [Errno 111] Connection refused
> 
> /usr/lib/python3/dist-packages/socks.py:800: ProxyConnectionError
> 
> During handling of the above exception, another exception occurred:
> 
> self = <test.contrib.test_socks.TestSOCKS4Proxy object at 0x7f3afbd9e470>
> 
>     def test_socks_with_invalid_username(self) -> None:
>         def request_handler(listener: socket.socket) -> None:
>             sock = listener.accept()[0]
>     
>             handler = handle_socks4_negotiation(sock, username=b"user")
>             next(handler, None)
>     
>         self._start_server(request_handler)
>         proxy_url = f"socks4a://{self.host}:{self.port}"
>         with socks.SOCKSProxyManager(proxy_url, username="baduser") as pm:
>             with pytest.raises(NewConnectionError, match="different 
> user-ids"):
> >               pm.request("GET", "http://example.com";, retries=False)
> 
> test/contrib/test_socks.py:725: 
> _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
> _ 
> urllib3/_request_methods.py:135: in request
>     return self.request_encode_url(
> urllib3/_request_methods.py:182: in request_encode_url
>     return self.urlopen(method, url, **extra_kw)
> urllib3/poolmanager.py:443: in urlopen
>     response = conn.urlopen(method, u.request_uri, **kw)
> urllib3/connectionpool.py:843: in urlopen
>     retries = retries.increment(
> urllib3/util/retry.py:449: in increment
>     raise reraise(type(error), error, _stacktrace)
> urllib3/util/util.py:39: in reraise
>     raise value
> urllib3/connectionpool.py:789: in urlopen
>     response = self._make_request(
> urllib3/connectionpool.py:495: in _make_request
>     conn.request(
> urllib3/connection.py:441: in request
>     self.endheaders()
> /usr/lib/python3.13/http/client.py:1331: in endheaders
>     self._send_output(message_body, encode_chunked=encode_chunked)
> /usr/lib/python3.13/http/client.py:1091: in _send_output
>     self.send(msg)
> /usr/lib/python3.13/http/client.py:1035: in send
>     self.connect()
> urllib3/connection.py:279: in connect
>     self.sock = self._new_conn()
> _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
> _ 
> 
> self = <urllib3.contrib.socks.SOCKSConnection object at 0x7f3afc1a6570>
> 
>     def _new_conn(self) -> socks.socksocket:
>         """
>         Establish a new connection via the SOCKS proxy.
>         """
>         extra_kw: dict[str, typing.Any] = {}
>         if self.source_address:
>             extra_kw["source_address"] = self.source_address
>     
>         if self.socket_options:
>             extra_kw["socket_options"] = self.socket_options
>     
>         try:
>             conn = socks.create_connection(
>                 (self.host, self.port),
>                 proxy_type=self._socks_options["socks_version"],
>                 proxy_addr=self._socks_options["proxy_host"],
>                 proxy_port=self._socks_options["proxy_port"],
>                 proxy_username=self._socks_options["username"],
>                 proxy_password=self._socks_options["password"],
>                 proxy_rdns=self._socks_options["rdns"],
>                 timeout=self.timeout,
>                 **extra_kw,
>             )
>     
>         except SocketTimeout as e:
>             raise ConnectTimeoutError(
>                 self,
>                 f"Connection to {self.host} timed out. (connect 
> timeout={self.timeout})",
>             ) from e
>     
>         except socks.ProxyError as e:
>             # This is fragile as hell, but it seems to be the only way to 
> raise
>             # useful errors here.
>             if e.socket_err:
>                 error = e.socket_err
>                 if isinstance(error, SocketTimeout):
>                     raise ConnectTimeoutError(
>                         self,
>                         f"Connection to {self.host} timed out. (connect 
> timeout={self.timeout})",
>                     ) from e
>                 else:
>                     # Adding `from e` messes with coverage somehow, so it's 
> omitted.
>                     # See #2386.
> >                   raise NewConnectionError(
>                         self, f"Failed to establish a new connection: {error}"
>                     )
> E                   urllib3.exceptions.NewConnectionError: 
> <urllib3.contrib.socks.SOCKSConnection object at 0x7f3afc1a6570>: Failed to 
> establish a new connection: [Errno 111] Connection refused
> 
> urllib3/contrib/socks.py:141: NewConnectionError
> 
> During handling of the above exception, another exception occurred:
> 
> self = <test.contrib.test_socks.TestSOCKS4Proxy object at 0x7f3afbd9e470>
> 
>     def test_socks_with_invalid_username(self) -> None:
>         def request_handler(listener: socket.socket) -> None:
>             sock = listener.accept()[0]
>     
>             handler = handle_socks4_negotiation(sock, username=b"user")
>             next(handler, None)
>     
>         self._start_server(request_handler)
>         proxy_url = f"socks4a://{self.host}:{self.port}"
>         with socks.SOCKSProxyManager(proxy_url, username="baduser") as pm:
> >           with pytest.raises(NewConnectionError, match="different 
> > user-ids"):
> E           AssertionError: Regex pattern did not match.
> E            Regex: 'different user-ids'
> E            Input: '<urllib3.contrib.socks.SOCKSConnection object at 
> 0x7f3afc1a6570>: Failed to establish a new connection: [Errno 111] Connection 
> refused'
> 
> test/contrib/test_socks.py:724: AssertionError
> ------------------------------ Captured log call 
> -------------------------------
> DEBUG    urllib3.util.retry:retry.py:286 Converted retries value: False -> 
> Retry(total=False, connect=None, read=None, redirect=0, status=None)
> DEBUG    urllib3.connectionpool:connectionpool.py:243 Starting new HTTP 
> connection (1): example.com:80
> DEBUG    socks:socks.py:799 Error connecting to SOCKS4 proxy localhost:38485 
> due to: [Errno 111] Connection refused
> =============================== warnings summary 
> ===============================
> test/contrib/test_pyopenssl.py: 29 warnings
> test/contrib/test_socks.py: 17 warnings
> test/test_ssltransport.py: 12 warnings
> test/with_dummyserver/test_chunked_transfer.py: 23 warnings
> test/with_dummyserver/test_connectionpool.py: 5 warnings
> test/with_dummyserver/test_socketlevel.py: 114 warnings
>   
> /<<PKGBUILDDIR>>/.pybuild/cpython3_3.13_urllib3/build/dummyserver/socketserver.py:125:
>  NoIPv6Warning: No IPv6 support. Falling back to IPv4.
>     warnings.warn("No IPv6 support. Falling back to IPv4.", NoIPv6Warning)
> 
> test/contrib/test_pyopenssl.py: 14 warnings
> test/with_dummyserver/test_socketlevel.py: 16 warnings
>   
> /<<PKGBUILDDIR>>/.pybuild/cpython3_3.13_urllib3/build/test/with_dummyserver/test_socketlevel.py:151:
>  DeprecationWarning: ssl.PROTOCOL_TLS is deprecated
>     context = ssl.SSLContext(ssl_version)
> 
> test/contrib/test_socks.py::TestSOCKSWithTLS::test_basic_request
>   
> /<<PKGBUILDDIR>>/.pybuild/cpython3_3.13_urllib3/build/test/contrib/test_socks.py:747:
>  DeprecationWarning: ssl.PROTOCOL_TLS is deprecated
>     context = better_ssl.SSLContext(ssl.PROTOCOL_SSLv23)  # type: ignore[misc]
> 
> test/test_ssl.py::TestSSL::test_create_urllib3_context_ssl_version_and_ssl_min_max_version_no_error[kwargs0]
> test/test_ssl.py::TestSSL::test_create_urllib3_context_ssl_version_and_ssl_min_max_version_no_error[kwargs1]
> test/test_ssl.py::TestSSL::test_create_urllib3_context_ssl_version_and_ssl_min_max_version_no_error[kwargs2]
>   
> /<<PKGBUILDDIR>>/.pybuild/cpython3_3.13_urllib3/build/urllib3/util/ssl_.py:295:
>  DeprecationWarning: ssl.TLSVersion.TLSv1 is deprecated
>     context.minimum_version = ssl_minimum_version
> 
> test/test_ssl.py::TestSSL::test_create_urllib3_context_ssl_version_and_ssl_min_max_version_no_error[kwargs0]
> test/test_ssl.py::TestSSL::test_create_urllib3_context_ssl_version_and_ssl_min_max_version_no_error[kwargs1]
> test/test_ssl.py::TestSSL::test_create_urllib3_context_ssl_version_and_ssl_min_max_version_no_error[kwargs2]
>   
> /<<PKGBUILDDIR>>/.pybuild/cpython3_3.13_urllib3/build/urllib3/util/ssl_.py:300:
>  DeprecationWarning: ssl.TLSVersion.TLSv1 is deprecated
>     context.maximum_version = ssl_maximum_version
> 
> test/with_dummyserver/test_connectionpool.py::TestConnectionPool::test_source_address
>   
> /<<PKGBUILDDIR>>/.pybuild/cpython3_3.13_urllib3/build/test/with_dummyserver/test_connectionpool.py:802:
>  NoIPv6Warning: No IPv6 support: skipping.
>     warnings.warn("No IPv6 support: skipping.", NoIPv6Warning)
> 
> test/with_dummyserver/test_socketlevel.py::TestClientCerts::test_client_cert_with_string_password
> test/with_dummyserver/test_socketlevel.py::TestClientCerts::test_client_cert_with_bytes_password
>   
> /<<PKGBUILDDIR>>/.pybuild/cpython3_3.13_urllib3/build/test/with_dummyserver/test_socketlevel.py:359:
>  DeprecationWarning: ssl.PROTOCOL_TLS is deprecated
>     ssl_context = ssl_.SSLContext(ssl_.PROTOCOL_SSLv23)
> 
> test/with_dummyserver/test_socketlevel.py::TestClientCerts::test_load_keyfile_with_invalid_password
>   
> /<<PKGBUILDDIR>>/.pybuild/cpython3_3.13_urllib3/build/test/with_dummyserver/test_socketlevel.py:378:
>  DeprecationWarning: ssl.PROTOCOL_TLS is deprecated
>     context = ssl_.SSLContext(ssl_.PROTOCOL_SSLv23)
> 
> test/with_dummyserver/test_socketlevel.py::TestClientCerts::test_load_invalid_cert_file
>   
> /<<PKGBUILDDIR>>/.pybuild/cpython3_3.13_urllib3/build/test/with_dummyserver/test_socketlevel.py:388:
>  DeprecationWarning: ssl.PROTOCOL_TLS is deprecated
>     context = ssl_.SSLContext(ssl_.PROTOCOL_SSLv23)
> 
> -- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
> =========================== short test summary info 
> ============================
> FAILED 
> test/contrib/test_socks.py::TestSOCKS4Proxy::test_socks_with_invalid_username 
> - AssertionError: Regex pattern did not match.
>  Regex: 'different user-ids'
>  Input: '<urllib3.contrib.socks.SOCKSConnection object at 0x7f3afc1a6570>: 
> Failed to establish a new connection: [Errno 111] Connection refused'
> = 1 failed, 1801 passed, 295 skipped, 41 deselected, 4 xfailed, 242 warnings 
> in 72.42s (0:01:12) =
> E: pybuild pybuild:389: test: plugin pyproject failed with: exit code=1: cd 
> /<<PKGBUILDDIR>>/.pybuild/cpython3_3.13_urllib3/build; python3.13 -m pytest 
> -k "not requires_network and not test_recent_date"
> I: pybuild base:311: cd 
> /<<PKGBUILDDIR>>/.pybuild/cpython3_3.12_urllib3/build; python3.12 -m pytest 
> -k "not requires_network and not test_recent_date"
> ============================= test session starts 
> ==============================
> platform linux -- Python 3.12.8, pytest-8.3.4, pluggy-1.5.0
> rootdir: /<<PKGBUILDDIR>>/.pybuild/cpython3_3.12_urllib3/build
> configfile: pyproject.toml
> plugins: timeout-2.3.1, typeguard-4.4.1, anyio-4.6.2
> collected 2141 items / 41 deselected / 1 skipped / 2100 selected
> 
> test/contrib/test_pyopenssl.py ......................................... [  
> 1%]
> ..........................ssssssssssssssssssssssssssssssssssssssssssssss [  
> 5%]
> ssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss [  
> 8%]
> ssss.............................................s......xs.............. [ 
> 12%]
> ..............................s.....s......xs...s....................... [ 
> 15%]
> ...........sssss....                                                     [ 
> 16%]
> test/contrib/test_pyopenssl_dependencies.py ..                           [ 
> 16%]
> test/contrib/test_socks.py .................F.                           [ 
> 17%]
> test/test_collections.py .............................................   [ 
> 19%]
> test/test_compatibility.py ..                                            [ 
> 19%]
> test/test_connection.py ................................................ [ 
> 22%]
> ........................................................................ [ 
> 25%]
> ........................................................................ [ 
> 29%]
> ........................................................................ [ 
> 32%]
> ..............                                                           [ 
> 33%]
> test/test_connectionpool.py ............................................ [ 
> 35%]
> ..............................                                           [ 
> 36%]
> test/test_exceptions.py ..............                                   [ 
> 37%]
> test/test_fields.py ....................                                 [ 
> 38%]
> test/test_filepost.py .........                                          [ 
> 38%]
> test/test_http2_connection.py ..................                         [ 
> 39%]
> test/test_no_ssl.py ..                                                   [ 
> 39%]
> test/test_poolmanager.py .....................................           [ 
> 41%]
> test/test_proxymanager.py ......                                         [ 
> 41%]
> test/test_queue_monkeypatch.py .                                         [ 
> 41%]
> test/test_response.py .........................................sssssssss [ 
> 44%]
> ssss.................................................................... [ 
> 47%]
> ........                                                                 [ 
> 47%]
> test/test_retry.py ..................................................... [ 
> 50%]
> ........                                                                 [ 
> 50%]
> test/test_ssl.py ...........................................             [ 
> 52%]
> test/test_ssltransport.py .................                              [ 
> 53%]
> test/test_util.py ...................................................... [ 
> 56%]
> ........................................................................ [ 
> 59%]
> ........................................................................ [ 
> 63%]
> .........................................s.ss..s.ss..................... [ 
> 66%]
> .................................................................        [ 
> 69%]
> test/test_wait.py .............                                          [ 
> 70%]
> test/with_dummyserver/test_chunked_transfer.py .......................   [ 
> 71%]
> test/with_dummyserver/test_connection.py ........                        [ 
> 71%]
> test/with_dummyserver/test_connectionpool.py ........................... [ 
> 73%]
> ........................................................................ [ 
> 76%]
> ....................                                                     [ 
> 77%]
> test/with_dummyserver/test_https.py ssssssssssssssssssssssssssssssssssss [ 
> 79%]
> ssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss [ 
> 82%]
> ssssssssss....................................................xs........ [ 
> 85%]
> ....................................s............xs...s...s..s.....ss... [ 
> 89%]
> ssss                                                                     [ 
> 89%]
> test/with_dummyserver/test_no_ssl.py ..                                  [ 
> 89%]
> test/with_dummyserver/test_poolmanager.py .............................. [ 
> 91%]
> .................s                                                       [ 
> 91%]
> test/with_dummyserver/test_proxy_poolmanager.py ........................ [ 
> 93%]
> .......s....s..s......                                                   [ 
> 94%]
> test/with_dummyserver/test_socketlevel.py .............................. [ 
> 95%]
> .................sssss.............................................s.s.s [ 
> 99%]
> .....................                                                    
> [100%]
> 
> =================================== FAILURES 
> ===================================
> _______________ TestSOCKS4Proxy.test_socks_with_invalid_username 
> _______________
> 
> self = <socks.socksocket [closed] fd=-1, family=2, type=1, proto=6>
> dest_pair = ('example.com', 80), catch_errors = None
> 
>     @set_self_blocking
>     def connect(self, dest_pair, catch_errors=None):
>         """
>         Connects to the specified destination through a proxy.
>         Uses the same API as socket's connect().
>         To select the proxy server, use set_proxy().
>     
>         dest_pair - 2-tuple of (IP/hostname, port).
>         """
>         if len(dest_pair) != 2 or dest_pair[0].startswith("["):
>             # Probably IPv6, not supported -- raise an error, and hope
>             # Happy Eyeballs (RFC6555) makes sure at least the IPv4
>             # connection works...
>             raise socket.error("PySocks doesn't support IPv6: %s"
>                                % str(dest_pair))
>     
>         dest_addr, dest_port = dest_pair
>     
>         if self.type == socket.SOCK_DGRAM:
>             if not self._proxyconn:
>                 self.bind(("", 0))
>             dest_addr = socket.gethostbyname(dest_addr)
>     
>             # If the host address is INADDR_ANY or similar, reset the peer
>             # address so that packets are received from any peer
>             if dest_addr == "0.0.0.0" and not dest_port:
>                 self.proxy_peername = None
>             else:
>                 self.proxy_peername = (dest_addr, dest_port)
>             return
>     
>         (proxy_type, proxy_addr, proxy_port, rdns, username,
>          password) = self.proxy
>     
>         # Do a minimal input check first
>         if (not isinstance(dest_pair, (list, tuple))
>                 or len(dest_pair) != 2
>                 or not dest_addr
>                 or not isinstance(dest_port, int)):
>             # Inputs failed, raise an error
>             raise GeneralProxyError(
>                 "Invalid destination-connection (host, port) pair")
>     
>         # We set the timeout here so that we don't hang in connection or 
> during
>         # negotiation.
>         super(socksocket, self).settimeout(self._timeout)
>     
>         if proxy_type is None:
>             # Treat like regular socket object
>             self.proxy_peername = dest_pair
>             super(socksocket, self).settimeout(self._timeout)
>             super(socksocket, self).connect((dest_addr, dest_port))
>             return
>     
>         proxy_addr = self._proxy_addr()
>     
>         try:
>             # Initial connection to proxy server.
> >           super(socksocket, self).connect(proxy_addr)
> E           ConnectionRefusedError: [Errno 111] Connection refused
> 
> /usr/lib/python3/dist-packages/socks.py:787: ConnectionRefusedError
> 
> During handling of the above exception, another exception occurred:
> 
> self = <urllib3.contrib.socks.SOCKSConnection object at 0x7fe290676b40>
> 
>     def _new_conn(self) -> socks.socksocket:
>         """
>         Establish a new connection via the SOCKS proxy.
>         """
>         extra_kw: dict[str, typing.Any] = {}
>         if self.source_address:
>             extra_kw["source_address"] = self.source_address
>     
>         if self.socket_options:
>             extra_kw["socket_options"] = self.socket_options
>     
>         try:
> >           conn = socks.create_connection(
>                 (self.host, self.port),
>                 proxy_type=self._socks_options["socks_version"],
>                 proxy_addr=self._socks_options["proxy_host"],
>                 proxy_port=self._socks_options["proxy_port"],
>                 proxy_username=self._socks_options["username"],
>                 proxy_password=self._socks_options["password"],
>                 proxy_rdns=self._socks_options["rdns"],
>                 timeout=self.timeout,
>                 **extra_kw,
>             )
> 
> urllib3/contrib/socks.py:110: 
> _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
> _ 
> /usr/lib/python3/dist-packages/socks.py:209: in create_connection
>     raise err
> /usr/lib/python3/dist-packages/socks.py:199: in create_connection
>     sock.connect((remote_host, remote_port))
> /usr/lib/python3/dist-packages/socks.py:47: in wrapper
>     return function(*args, **kwargs)
> _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
> _ 
> 
> self = <socks.socksocket [closed] fd=-1, family=2, type=1, proto=6>
> dest_pair = ('example.com', 80), catch_errors = None
> 
>     @set_self_blocking
>     def connect(self, dest_pair, catch_errors=None):
>         """
>         Connects to the specified destination through a proxy.
>         Uses the same API as socket's connect().
>         To select the proxy server, use set_proxy().
>     
>         dest_pair - 2-tuple of (IP/hostname, port).
>         """
>         if len(dest_pair) != 2 or dest_pair[0].startswith("["):
>             # Probably IPv6, not supported -- raise an error, and hope
>             # Happy Eyeballs (RFC6555) makes sure at least the IPv4
>             # connection works...
>             raise socket.error("PySocks doesn't support IPv6: %s"
>                                % str(dest_pair))
>     
>         dest_addr, dest_port = dest_pair
>     
>         if self.type == socket.SOCK_DGRAM:
>             if not self._proxyconn:
>                 self.bind(("", 0))
>             dest_addr = socket.gethostbyname(dest_addr)
>     
>             # If the host address is INADDR_ANY or similar, reset the peer
>             # address so that packets are received from any peer
>             if dest_addr == "0.0.0.0" and not dest_port:
>                 self.proxy_peername = None
>             else:
>                 self.proxy_peername = (dest_addr, dest_port)
>             return
>     
>         (proxy_type, proxy_addr, proxy_port, rdns, username,
>          password) = self.proxy
>     
>         # Do a minimal input check first
>         if (not isinstance(dest_pair, (list, tuple))
>                 or len(dest_pair) != 2
>                 or not dest_addr
>                 or not isinstance(dest_port, int)):
>             # Inputs failed, raise an error
>             raise GeneralProxyError(
>                 "Invalid destination-connection (host, port) pair")
>     
>         # We set the timeout here so that we don't hang in connection or 
> during
>         # negotiation.
>         super(socksocket, self).settimeout(self._timeout)
>     
>         if proxy_type is None:
>             # Treat like regular socket object
>             self.proxy_peername = dest_pair
>             super(socksocket, self).settimeout(self._timeout)
>             super(socksocket, self).connect((dest_addr, dest_port))
>             return
>     
>         proxy_addr = self._proxy_addr()
>     
>         try:
>             # Initial connection to proxy server.
>             super(socksocket, self).connect(proxy_addr)
>     
>         except socket.error as error:
>             # Error while connecting to proxy
>             self.close()
>             if not catch_errors:
>                 proxy_addr, proxy_port = proxy_addr
>                 proxy_server = "{}:{}".format(proxy_addr, proxy_port)
>                 printable_type = PRINTABLE_PROXY_TYPES[proxy_type]
>     
>                 msg = "Error connecting to {} proxy {}".format(printable_type,
>                                                                     
> proxy_server)
>                 log.debug("%s due to: %s", msg, error)
> >               raise ProxyConnectionError(msg, error)
> E               socks.ProxyConnectionError: Error connecting to SOCKS4 proxy 
> localhost:34855: [Errno 111] Connection refused
> 
> /usr/lib/python3/dist-packages/socks.py:800: ProxyConnectionError
> 
> During handling of the above exception, another exception occurred:
> 
> self = <test.contrib.test_socks.TestSOCKS4Proxy object at 0x7fe290ec5460>
> 
>     def test_socks_with_invalid_username(self) -> None:
>         def request_handler(listener: socket.socket) -> None:
>             sock = listener.accept()[0]
>     
>             handler = handle_socks4_negotiation(sock, username=b"user")
>             next(handler, None)
>     
>         self._start_server(request_handler)
>         proxy_url = f"socks4a://{self.host}:{self.port}"
>         with socks.SOCKSProxyManager(proxy_url, username="baduser") as pm:
>             with pytest.raises(NewConnectionError, match="different 
> user-ids"):
> >               pm.request("GET", "http://example.com";, retries=False)
> 
> test/contrib/test_socks.py:725: 
> _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
> _ 
> urllib3/_request_methods.py:135: in request
>     return self.request_encode_url(
> urllib3/_request_methods.py:182: in request_encode_url
>     return self.urlopen(method, url, **extra_kw)
> urllib3/poolmanager.py:443: in urlopen
>     response = conn.urlopen(method, u.request_uri, **kw)
> urllib3/connectionpool.py:843: in urlopen
>     retries = retries.increment(
> urllib3/util/retry.py:449: in increment
>     raise reraise(type(error), error, _stacktrace)
> urllib3/util/util.py:39: in reraise
>     raise value
> urllib3/connectionpool.py:789: in urlopen
>     response = self._make_request(
> urllib3/connectionpool.py:495: in _make_request
>     conn.request(
> urllib3/connection.py:441: in request
>     self.endheaders()
> /usr/lib/python3.12/http/client.py:1331: in endheaders
>     self._send_output(message_body, encode_chunked=encode_chunked)
> /usr/lib/python3.12/http/client.py:1091: in _send_output
>     self.send(msg)
> /usr/lib/python3.12/http/client.py:1035: in send
>     self.connect()
> urllib3/connection.py:279: in connect
>     self.sock = self._new_conn()
> _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
> _ 
> 
> self = <urllib3.contrib.socks.SOCKSConnection object at 0x7fe290676b40>
> 
>     def _new_conn(self) -> socks.socksocket:
>         """
>         Establish a new connection via the SOCKS proxy.
>         """
>         extra_kw: dict[str, typing.Any] = {}
>         if self.source_address:
>             extra_kw["source_address"] = self.source_address
>     
>         if self.socket_options:
>             extra_kw["socket_options"] = self.socket_options
>     
>         try:
>             conn = socks.create_connection(
>                 (self.host, self.port),
>                 proxy_type=self._socks_options["socks_version"],
>                 proxy_addr=self._socks_options["proxy_host"],
>                 proxy_port=self._socks_options["proxy_port"],
>                 proxy_username=self._socks_options["username"],
>                 proxy_password=self._socks_options["password"],
>                 proxy_rdns=self._socks_options["rdns"],
>                 timeout=self.timeout,
>                 **extra_kw,
>             )
>     
>         except SocketTimeout as e:
>             raise ConnectTimeoutError(
>                 self,
>                 f"Connection to {self.host} timed out. (connect 
> timeout={self.timeout})",
>             ) from e
>     
>         except socks.ProxyError as e:
>             # This is fragile as hell, but it seems to be the only way to 
> raise
>             # useful errors here.
>             if e.socket_err:
>                 error = e.socket_err
>                 if isinstance(error, SocketTimeout):
>                     raise ConnectTimeoutError(
>                         self,
>                         f"Connection to {self.host} timed out. (connect 
> timeout={self.timeout})",
>                     ) from e
>                 else:
>                     # Adding `from e` messes with coverage somehow, so it's 
> omitted.
>                     # See #2386.
> >                   raise NewConnectionError(
>                         self, f"Failed to establish a new connection: {error}"
>                     )
> E                   urllib3.exceptions.NewConnectionError: 
> <urllib3.contrib.socks.SOCKSConnection object at 0x7fe290676b40>: Failed to 
> establish a new connection: [Errno 111] Connection refused
> 
> urllib3/contrib/socks.py:141: NewConnectionError
> 
> During handling of the above exception, another exception occurred:
> 
> self = <test.contrib.test_socks.TestSOCKS4Proxy object at 0x7fe290ec5460>
> 
>     def test_socks_with_invalid_username(self) -> None:
>         def request_handler(listener: socket.socket) -> None:
>             sock = listener.accept()[0]
>     
>             handler = handle_socks4_negotiation(sock, username=b"user")
>             next(handler, None)
>     
>         self._start_server(request_handler)
>         proxy_url = f"socks4a://{self.host}:{self.port}"
>         with socks.SOCKSProxyManager(proxy_url, username="baduser") as pm:
> >           with pytest.raises(NewConnectionError, match="different 
> > user-ids"):
> E           AssertionError: Regex pattern did not match.
> E            Regex: 'different user-ids'
> E            Input: '<urllib3.contrib.socks.SOCKSConnection object at 
> 0x7fe290676b40>: Failed to establish a new connection: [Errno 111] Connection 
> refused'
> 
> test/contrib/test_socks.py:724: AssertionError
> ------------------------------ Captured log call 
> -------------------------------
> DEBUG    urllib3.util.retry:retry.py:286 Converted retries value: False -> 
> Retry(total=False, connect=None, read=None, redirect=0, status=None)
> DEBUG    urllib3.connectionpool:connectionpool.py:243 Starting new HTTP 
> connection (1): example.com:80
> DEBUG    socks:socks.py:799 Error connecting to SOCKS4 proxy localhost:34855 
> due to: [Errno 111] Connection refused
> =============================== warnings summary 
> ===============================
> test/contrib/test_pyopenssl.py: 29 warnings
> test/contrib/test_socks.py: 17 warnings
> test/test_ssltransport.py: 12 warnings
> test/with_dummyserver/test_chunked_transfer.py: 23 warnings
> test/with_dummyserver/test_connectionpool.py: 5 warnings
> test/with_dummyserver/test_socketlevel.py: 114 warnings
>   
> /<<PKGBUILDDIR>>/.pybuild/cpython3_3.12_urllib3/build/dummyserver/socketserver.py:125:
>  NoIPv6Warning: No IPv6 support. Falling back to IPv4.
>     warnings.warn("No IPv6 support. Falling back to IPv4.", NoIPv6Warning)
> 
> test/contrib/test_pyopenssl.py: 14 warnings
> test/with_dummyserver/test_socketlevel.py: 16 warnings
>   
> /<<PKGBUILDDIR>>/.pybuild/cpython3_3.12_urllib3/build/test/with_dummyserver/test_socketlevel.py:151:
>  DeprecationWarning: ssl.PROTOCOL_TLS is deprecated
>     context = ssl.SSLContext(ssl_version)
> 
> test/contrib/test_socks.py::TestSOCKSWithTLS::test_basic_request
>   
> /<<PKGBUILDDIR>>/.pybuild/cpython3_3.12_urllib3/build/test/contrib/test_socks.py:747:
>  DeprecationWarning: ssl.PROTOCOL_TLS is deprecated
>     context = better_ssl.SSLContext(ssl.PROTOCOL_SSLv23)  # type: ignore[misc]
> 
> test/test_ssl.py::TestSSL::test_create_urllib3_context_ssl_version_and_ssl_min_max_version_no_error[kwargs0]
> test/test_ssl.py::TestSSL::test_create_urllib3_context_ssl_version_and_ssl_min_max_version_no_error[kwargs1]
> test/test_ssl.py::TestSSL::test_create_urllib3_context_ssl_version_and_ssl_min_max_version_no_error[kwargs2]
>   
> /<<PKGBUILDDIR>>/.pybuild/cpython3_3.12_urllib3/build/urllib3/util/ssl_.py:295:
>  DeprecationWarning: ssl.TLSVersion.TLSv1 is deprecated
>     context.minimum_version = ssl_minimum_version
> 
> test/test_ssl.py::TestSSL::test_create_urllib3_context_ssl_version_and_ssl_min_max_version_no_error[kwargs0]
> test/test_ssl.py::TestSSL::test_create_urllib3_context_ssl_version_and_ssl_min_max_version_no_error[kwargs1]
> test/test_ssl.py::TestSSL::test_create_urllib3_context_ssl_version_and_ssl_min_max_version_no_error[kwargs2]
>   
> /<<PKGBUILDDIR>>/.pybuild/cpython3_3.12_urllib3/build/urllib3/util/ssl_.py:300:
>  DeprecationWarning: ssl.TLSVersion.TLSv1 is deprecated
>     context.maximum_version = ssl_maximum_version
> 
> test/with_dummyserver/test_connectionpool.py::TestConnectionPool::test_source_address
>   
> /<<PKGBUILDDIR>>/.pybuild/cpython3_3.12_urllib3/build/test/with_dummyserver/test_connectionpool.py:802:
>  NoIPv6Warning: No IPv6 support: skipping.
>     warnings.warn("No IPv6 support: skipping.", NoIPv6Warning)
> 
> test/with_dummyserver/test_socketlevel.py::TestClientCerts::test_client_cert_with_string_password
> test/with_dummyserver/test_socketlevel.py::TestClientCerts::test_client_cert_with_bytes_password
>   
> /<<PKGBUILDDIR>>/.pybuild/cpython3_3.12_urllib3/build/test/with_dummyserver/test_socketlevel.py:359:
>  DeprecationWarning: ssl.PROTOCOL_TLS is deprecated
>     ssl_context = ssl_.SSLContext(ssl_.PROTOCOL_SSLv23)
> 
> test/with_dummyserver/test_socketlevel.py::TestClientCerts::test_load_keyfile_with_invalid_password
>   
> /<<PKGBUILDDIR>>/.pybuild/cpython3_3.12_urllib3/build/test/with_dummyserver/test_socketlevel.py:378:
>  DeprecationWarning: ssl.PROTOCOL_TLS is deprecated
>     context = ssl_.SSLContext(ssl_.PROTOCOL_SSLv23)
> 
> test/with_dummyserver/test_socketlevel.py::TestClientCerts::test_load_invalid_cert_file
>   
> /<<PKGBUILDDIR>>/.pybuild/cpython3_3.12_urllib3/build/test/with_dummyserver/test_socketlevel.py:388:
>  DeprecationWarning: ssl.PROTOCOL_TLS is deprecated
>     context = ssl_.SSLContext(ssl_.PROTOCOL_SSLv23)
> 
> -- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
> =========================== short test summary info 
> ============================
> FAILED 
> test/contrib/test_socks.py::TestSOCKS4Proxy::test_socks_with_invalid_username 
> - AssertionError: Regex pattern did not match.
>  Regex: 'different user-ids'
>  Input: '<urllib3.contrib.socks.SOCKSConnection object at 0x7fe290676b40>: 
> Failed to establish a new connection: [Errno 111] Connection refused'
> = 1 failed, 1801 passed, 295 skipped, 41 deselected, 4 xfailed, 242 warnings 
> in 72.71s (0:01:12) =
> E: pybuild pybuild:389: test: plugin pyproject failed with: exit code=1: cd 
> /<<PKGBUILDDIR>>/.pybuild/cpython3_3.12_urllib3/build; python3.12 -m pytest 
> -k "not requires_network and not test_recent_date"
> dh_auto_test: error: pybuild --test -i python{version} -p "3.13 3.12" 
> returned exit code 13


The full build log is available from:
http://qa-logs.debian.net/2024/12/22/python-urllib3_2.2.3-4_unstable.log

All bugs filed during this archive rebuild are listed at:
https://bugs.debian.org/cgi-bin/pkgreport.cgi?tag=ftbfs-20241222;[email protected]
or:
https://udd.debian.org/bugs/?release=na&merged=ign&fnewerval=7&flastmodval=7&fusertag=only&fusertagtag=ftbfs-20241222&[email protected]&allbugs=1&cseverity=1&ctags=1&caffected=1#results

A list of current common problems and possible solutions is available at
http://wiki.debian.org/qa.debian.org/FTBFS . You're welcome to contribute!

If you reassign this bug to another package, please mark it as 'affects'-ing
this package. See https://www.debian.org/Bugs/server-control#affects

If you fail to reproduce this, please provide a build log and diff it with mine
so that we can identify if something relevant changed in the meantime.

Reply via email to