From a43bf4dd115aa7f9a63a4c729c3f38228c45e633 Mon Sep 17 00:00:00 2001 From: Ricardo Branco Date: Mon, 29 Apr 2024 17:24:18 +0200 Subject: [PATCH] devel/py-python-bugzilla: Fix for API key leak --- devel/py-bugzilla/Makefile | 1 + devel/py-bugzilla/distinfo | 1 + .../patches/patch-bugzilla___session.py | 23 +++++++++++++++++++ 3 files changed, 25 insertions(+) create mode 100644 devel/py-bugzilla/patches/patch-bugzilla___session.py diff --git a/devel/py-bugzilla/Makefile b/devel/py-bugzilla/Makefile index b34e5600696a..6c8091a288df 100644 --- a/devel/py-bugzilla/Makefile +++ b/devel/py-bugzilla/Makefile @@ -2,6 +2,7 @@ DISTNAME= python-bugzilla-3.2.0 PKGNAME= ${PYPKGPREFIX}-${DISTNAME} +PKGREVISION= 1 CATEGORIES= devel python MASTER_SITES= ${MASTER_SITE_PYPI:=p/python-bugzilla/} diff --git a/devel/py-bugzilla/distinfo b/devel/py-bugzilla/distinfo index 916951959f7e..8d2426237249 100644 --- a/devel/py-bugzilla/distinfo +++ b/devel/py-bugzilla/distinfo @@ -3,3 +3,4 @@ $NetBSD: distinfo,v 1.5 2022/07/08 14:01:33 wiz Exp $ BLAKE2s (python-bugzilla-3.2.0.tar.gz) = d92cf6d3e3defd7f44349756507f631041851581395b3a303159d692201f441d SHA512 (python-bugzilla-3.2.0.tar.gz) = 215945a0ffd637be5567839303a738a0eef74427838bf0074a5f0ab6022306f47fc0dd5c43a3513b627fb458711f38046321ee9c2c3d43b61ffc577d6dd12375 Size (python-bugzilla-3.2.0.tar.gz) = 114279 bytes +SHA1 (patch-bugzilla___session.py) = 76b9c42367f26cba73923f2cbe6ba03a8aeb7b3e diff --git a/devel/py-bugzilla/patches/patch-bugzilla___session.py b/devel/py-bugzilla/patches/patch-bugzilla___session.py new file mode 100644 index 000000000000..bf9849a0eef2 --- /dev/null +++ b/devel/py-bugzilla/patches/patch-bugzilla___session.py @@ -0,0 +1,23 @@ +--- bugzilla/_session.py ++++ bugzilla/_session.py +@@ -98,14 +98,14 @@ def request(self, *args, **kwargs): + if "timeout" not in kwargs: + kwargs["timeout"] = timeout + +- response = self._session.request(*args, **kwargs) ++ try: ++ response = self._session.request(*args, **kwargs) + +- if self._is_xmlrpc: +- # Yes this still appears to matter for properly decoding unicode +- # code points in bugzilla.redhat.com content +- response.encoding = "UTF-8" ++ if self._is_xmlrpc: ++ # This still appears to matter for properly decoding unicode ++ # code points in bugzilla.redhat.com content ++ response.encoding = "UTF-8" + +- try: + response.raise_for_status() + except requests.HTTPError as e: + # Scrape the api key out of the returned exception string