From 6c44b17c2313cd5a09753c122597dc2bf0a1100c Mon Sep 17 00:00:00 2001 From: Ryan Hefner Date: Tue, 9 Dec 2025 15:18:41 +0000 Subject: [PATCH] fix: use urllib3 headers API and require >=2.6.1 urllib3 2.6.0 removed HTTPResponse.getheader/getheaders (which were already deprecated shims), which made RESTResponse crash with AttributeError. Switch to headers.get/headers and also pin urllib3 to 2.6.1+. --- gooddata-api-client/gooddata_api_client/rest.py | 4 ++-- gooddata-api-client/requirements.txt | 2 +- gooddata-api-client/setup.py | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/gooddata-api-client/gooddata_api_client/rest.py b/gooddata-api-client/gooddata_api_client/rest.py index cc9e27616..c7113e55b 100644 --- a/gooddata-api-client/gooddata_api_client/rest.py +++ b/gooddata-api-client/gooddata_api_client/rest.py @@ -36,11 +36,11 @@ def __init__(self, resp): def getheaders(self): """Returns a dictionary of the response headers.""" - return self.urllib3_response.getheaders() + return self.urllib3_response.headers def getheader(self, name, default=None): """Returns a given response header.""" - return self.urllib3_response.getheader(name, default) + return self.urllib3_response.headers.get(name, default) class RESTClientObject(object): diff --git a/gooddata-api-client/requirements.txt b/gooddata-api-client/requirements.txt index 96947f604..b4cc09807 100644 --- a/gooddata-api-client/requirements.txt +++ b/gooddata-api-client/requirements.txt @@ -1,3 +1,3 @@ python_dateutil >= 2.5.3 setuptools >= 21.0.0 -urllib3 >= 1.25.3 +urllib3 >= 2.6.1 diff --git a/gooddata-api-client/setup.py b/gooddata-api-client/setup.py index 82a6e97f3..e3493a1d7 100644 --- a/gooddata-api-client/setup.py +++ b/gooddata-api-client/setup.py @@ -25,7 +25,7 @@ # http://pypi.python.org/pypi/setuptools REQUIRES = [ - "urllib3 >= 1.25.3", + "urllib3 >= 2.6.1", "python-dateutil", ]