From 375d472ecd70cfc071e48d846f2fed4b9890e280 Mon Sep 17 00:00:00 2001 From: arch_agent Date: Tue, 4 Aug 2026 09:47:40 +0200 Subject: [PATCH] =?UTF-8?q?fix:=20AUR=20RPC=20API=20404=20=E2=80=94=20use?= =?UTF-8?q?=20list=20params=20for=20arg[]=20encoding?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- aur_shield/aur_client.py | 30 ++++++++++++++++++++---------- 1 file changed, 20 insertions(+), 10 deletions(-) diff --git a/aur_shield/aur_client.py b/aur_shield/aur_client.py index 4fe4c4b..67afcc8 100644 --- a/aur_shield/aur_client.py +++ b/aur_shield/aur_client.py @@ -34,11 +34,16 @@ class AURSource: async def aur_info(name: str) -> AURPackage | None: """Fetch package info from AUR RPC API.""" async with httpx.AsyncClient(timeout=30) as client: - resp = await client.get(AUR_RPC, params={ - "type": "info", - "v": "5", - "arg[]": name, - }) + resp = await client.get( + AUR_RPC, + params=[ + ("type", "info"), + ("v", "5"), + ("arg[]", name), + ], + ) + if resp.status_code == 404: + return None resp.raise_for_status() data: dict[str, Any] = resp.json() @@ -94,11 +99,16 @@ async def aur_sources(name: str) -> AURSource | None: async def _raw_info(name: str) -> dict[str, Any] | None: """Get raw RPC result for a package.""" async with httpx.AsyncClient(timeout=30) as client: - resp = await client.get(AUR_RPC, params={ - "type": "info", - "v": "5", - "arg[]": name, - }) + resp = await client.get( + AUR_RPC, + params=[ + ("type", "info"), + ("v", "5"), + ("arg[]", name), + ], + ) + if resp.status_code == 404: + return None resp.raise_for_status() data = resp.json()