-
Notifications
You must be signed in to change notification settings - Fork 4
Open
Description
Summary
sendbird-platform-sdk-python is incompatible with urllib3 >= 2.6.0 due to the use of the removed HTTPResponse.getheaders() and HTTPResponse.getheader() methods.
Environment
- Python version: 3.x
- urllib3 version: 2.6.0
- sendbird-platform-sdk version: latest
Error
When using urllib3 >= 2.6.0, the following error occurs:
AttributeError: 'HTTPResponse' object has no attribute 'getheaders'
# or
AttributeError: 'HTTPResponse' object has no attribute 'getheader'Root Cause
The HTTPResponse.getheaders() and HTTPResponse.getheader() methods were deprecated in urllib3 2.0.0 and have been removed in urllib3 2.6.0.
From the urllib3 2.6.0 changelog:
Removed the
HTTPResponse.getheaders()method in favor ofHTTPResponse.headers. Removed theHTTPResponse.getheader(name, default)method in favor ofHTTPResponse.headers.get(name, default).
Suggested Fix
# Before
response.getheaders()
response.getheader(name, default)
# After
response.headers
response.headers.get(name, default)References
- urllib3 PR that removed the methods: Remove getheader and getheaders methods urllib3/urllib3#3622
Workaround
Until this is fixed, pin urllib3 to a version below 2.6.0:
urllib3<2.6.0
Metadata
Metadata
Assignees
Labels
No labels