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 of HTTPResponse.headers. Removed the HTTPResponse.getheader(name, default) method in favor of HTTPResponse.headers.get(name, default).
Suggested Fix
# Before
response.getheaders()
response.getheader(name, default)
# After
response.headers
response.headers.get(name, default)
References
Workaround
Until this is fixed, pin urllib3 to a version below 2.6.0: