OOPS, submitted an incomplete patch. Here's a good one:
From b12cedcd268ed9fbd7a666a7c5339436d831de46 Mon Sep 17 00:00:00 2001 From: Sergey Popov <sergey.k...@gmail.com> Date: Mon, 3 Mar 2025 12:11:44 +0200 Subject: [PATCH v2] fix: httpx>=0.28.0 proxy compatibility
--- nala/downloader.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/nala/downloader.py b/nala/downloader.py index b2e31e8..0396c0f 100644 --- a/nala/downloader.py +++ b/nala/downloader.py @@ -48,6 +48,7 @@ from apt_pkg import Configuration, config from httpx import ( URL as HttpxUrl, AsyncClient, + AsyncHTTPTransport, ConnectError, ConnectTimeout, HTTPError, @@ -304,7 +305,7 @@ class Downloader: # pylint: disable=too-many-instance-attributes if common_proxy := config.find(f"Acquire::{proto}::Proxy"): # If the proxy is set to direct or false we disable it if common_proxy.lower() not in ("direct", "false"): - self.proxy[f"{proto}://"] = common_proxy + self.proxy[f"{proto}://"] = AsyncHTTPTransport(proxy=common_proxy) # The remainder of code is for proxying specific repos. Such a configuration may look like # Acquire::http::Proxy::deb.volian.org "xxx:8087" @@ -338,7 +339,7 @@ class Downloader: # pylint: disable=too-many-instance-attributes # If direct or false, disable the proxy if value.lower() in ("direct", "false"): value = None - self.proxy[f"{proto}://{key}"] = value + self.proxy[f"{proto}://{key}"] = AsyncHTTPTransport(proxy=value) async def _check_count(self, url: str) -> str: """Check the url count and return if Nala should continue.""" @@ -403,7 +404,7 @@ class Downloader: # pylint: disable=too-many-instance-attributes with Live(get_renderable=self._gen_table, refresh_per_second=10) as self.live: async with AsyncClient( timeout=20, - proxies=self.proxy, + mounts=self.proxy, follow_redirects=True, # Custom user agent fixes some downloading issues # Caused by httpx default agent sometimes being blocked. -- 2.47.2