From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 2CFC815815E for ; Fri, 9 Feb 2024 18:46:16 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 5E68EE29C2; Fri, 9 Feb 2024 18:46:15 +0000 (UTC) Received: from smtp.gentoo.org (woodpecker.gentoo.org [140.211.166.183]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 3AD68E29C2 for ; Fri, 9 Feb 2024 18:46:15 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 4F1FE3430FD for ; Fri, 9 Feb 2024 18:46:14 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id DE4F87E7 for ; Fri, 9 Feb 2024 18:46:12 +0000 (UTC) From: "Arthur Zamarin" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Arthur Zamarin" Message-ID: <1707501312.043cbef7cd6c6fa2ca73fbcdf6769ea21cfb5950.arthurzam@gentoo> Subject: [gentoo-commits] proj/pkgcore/pkgcheck:master commit in: src/pkgcheck/addons/ X-VCS-Repository: proj/pkgcore/pkgcheck X-VCS-Files: src/pkgcheck/addons/net.py X-VCS-Directories: src/pkgcheck/addons/ X-VCS-Committer: arthurzam X-VCS-Committer-Name: Arthur Zamarin X-VCS-Revision: 043cbef7cd6c6fa2ca73fbcdf6769ea21cfb5950 X-VCS-Branch: master Date: Fri, 9 Feb 2024 18:46:12 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: 149f0f95-c3ab-495c-b1d5-b53d1bc8cf9b X-Archives-Hash: cd0fb653a7557f1807295b8306ee884b commit: 043cbef7cd6c6fa2ca73fbcdf6769ea21cfb5950 Author: Anna “CyberTailor” sysrq in> AuthorDate: Thu Feb 1 16:53:50 2024 +0000 Commit: Arthur Zamarin gentoo org> CommitDate: Fri Feb 9 17:55:12 2024 +0000 URL: https://gitweb.gentoo.org/proj/pkgcore/pkgcheck.git/commit/?id=043cbef7 addons.net: suppress urllib3 import warnings Most notably, this includes NotOpenSSLWarning: https://github.com/urllib3/urllib3/issues/3020#issuecomment-1785873825 Signed-off-by: Anna “CyberTailor” sysrq.in> Closes: https://github.com/pkgcore/pkgcheck/pull/661 Signed-off-by: Arthur Zamarin gentoo.org> src/pkgcheck/addons/net.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/pkgcheck/addons/net.py b/src/pkgcheck/addons/net.py index 6db5432d..782d74d1 100644 --- a/src/pkgcheck/addons/net.py +++ b/src/pkgcheck/addons/net.py @@ -2,12 +2,14 @@ import logging import os - -import requests +import warnings from ..checks.network import RequestError, SSLError -# suppress all urllib3 log messages +# suppress all urllib3 log messages and import warnings +with warnings.catch_warnings(): + warnings.simplefilter("ignore") + import requests logging.getLogger("urllib3").propagate = False