From 769c0c183fd8a088655b0eee2ec4ded617f53bc1 Mon Sep 17 00:00:00 2001 From: nicolargo Date: Sun, 15 Feb 2026 14:41:16 +0100 Subject: [PATCH] Error fetching ip with urlopen_auth() - extra function argument #3438 --- glances/globals.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/glances/globals.py b/glances/globals.py index 66902d3b..9ee52b70 100644 --- a/glances/globals.py +++ b/glances/globals.py @@ -351,13 +351,14 @@ def pretty_date(ref, now=None): return '' -def urlopen_auth(url, username, password): +def urlopen_auth(url, username, password, timeout=3): """Open a url with basic auth""" return urlopen( Request( url, headers={'Authorization': 'Basic ' + base64.b64encode(f'{username}:{password}'.encode()).decode()}, - ) + ), + timeout=timeout, )