Skip to content

Commit ad23718

Browse files
committed
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+.
1 parent 1a9ebb6 commit ad23718

File tree

4 files changed

+26
-4
lines changed

4 files changed

+26
-4
lines changed

.devcontainer/devcontainer.json

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
2+
// README at: https://github.com/devcontainers/templates/tree/main/src/python
3+
{
4+
"name": "Python 3",
5+
// Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile
6+
"image": "mcr.microsoft.com/devcontainers/python:2-3.14-trixie"
7+
8+
// Features to add to the dev container. More info: https://containers.dev/features.
9+
// "features": {},
10+
11+
// Use 'forwardPorts' to make a list of ports inside the container available locally.
12+
// "forwardPorts": [],
13+
14+
// Use 'postCreateCommand' to run commands after the container is created.
15+
// "postCreateCommand": "pip3 install --user -r requirements.txt",
16+
17+
// Configure tool-specific properties.
18+
// "customizations": {},
19+
20+
// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.
21+
// "remoteUser": "root"
22+
}

gooddata-api-client/gooddata_api_client/rest.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,11 @@ def __init__(self, resp):
3636

3737
def getheaders(self):
3838
"""Returns a dictionary of the response headers."""
39-
return self.urllib3_response.getheaders()
39+
return self.urllib3_response.headers
4040

4141
def getheader(self, name, default=None):
4242
"""Returns a given response header."""
43-
return self.urllib3_response.getheader(name, default)
43+
return self.urllib3_response.headers.get(name, default)
4444

4545

4646
class RESTClientObject(object):
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
python_dateutil >= 2.5.3
22
setuptools >= 21.0.0
3-
urllib3 >= 1.25.3
3+
urllib3 >= 2.6.1

gooddata-api-client/setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
# http://pypi.python.org/pypi/setuptools
2626

2727
REQUIRES = [
28-
"urllib3 >= 1.25.3",
28+
"urllib3 >= 2.6.1",
2929
"python-dateutil",
3030
]
3131

0 commit comments

Comments
 (0)