From d8ccf33d8f832dd37593cda73bb5be3b71ec3847 Mon Sep 17 00:00:00 2001 From: Pedro Cunha Date: Sat, 13 Jun 2026 20:27:00 +0100 Subject: [PATCH] refactor(poller): replace deprecated aiohttp.BasicAuth aiohttp 3.14 deprecates aiohttp.BasicAuth (removed in 4.0). Build the Authorization header with aiohttp.encode_basic_auth() instead, which emits the identical "Basic " credentials for the ASCII GitHub client_id/client_secret in use. - mod_polling/poller.py: GitHub release auth now goes via headers= - scripts/test_regexes.py: same swap in the regex-testing script No behavior change; clears the DeprecationWarning surfaced by the aiohttp 3.14.0 upgrade in #321. --- mod_polling/poller.py | 3 ++- scripts/test_regexes.py | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/mod_polling/poller.py b/mod_polling/poller.py index 52e4a90..aaf028d 100644 --- a/mod_polling/poller.py +++ b/mod_polling/poller.py @@ -408,7 +408,8 @@ async def check_github_release(self, mod): url = "https://api.github.com/repos/" + repo + "/releases" if client_id and client_secret: - releases = await self.fetch_json(url, auth=aiohttp.BasicAuth(client_id, client_secret)) + headers = {"Authorization": aiohttp.encode_basic_auth(client_id, client_secret)} + releases = await self.fetch_json(url, headers=headers) else: releases = await self.fetch_json(url) diff --git a/scripts/test_regexes.py b/scripts/test_regexes.py index f77243e..161b8ff 100644 --- a/scripts/test_regexes.py +++ b/scripts/test_regexes.py @@ -235,7 +235,7 @@ async def check_github_release( kwargs = {} if client_id and client_secret: - kwargs["auth"] = aiohttp.BasicAuth(client_id, client_secret) + kwargs["headers"] = {"Authorization": aiohttp.encode_basic_auth(client_id, client_secret)} async with session.get(url, **kwargs) as resp: if resp.status >= 400: