AttributeError: 'HTTPResponse' object has no attribute 'getheader'

Open
#460 5 comments 16 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
48/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
python
Domain
api

Research direction

Start with hubspot/crm/companies/api_client.py and search the generated API clients for uses of HTTPResponse.getheader() and getheaders(). Check how the response headers are accessed, then verify that all such clients work with urllib3 2.6.0 without the removed methods.

Written by the indexing model from the issue text.

Description

As of urllib3 2.6.0, the deprecated HTTPResponse.getheaders() and HTTPResponse.getheader() methods have been removed and replaced by the headers attribute. ( https://github.com/urllib3/urllib3/blob/main/CHANGES.rst#260-2025-12-05 )

Both of the removed methods are used in the auto generated api client, for example: https://github.com/HubSpot/hubspot-api-python/blob/master/hubspot/crm/companies/api_client.py

The code needs to be updated to be compatible with the latest version of urllib3 in order to benefit from the bug and security fixes. Any chance this could be patched?

Dominant language
Python
Stars
434
Forks
126
PR merge metrics
No merged PRs in 30d

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from HubSpot/hubspot-api-python

All issues in HubSpot/hubspot-api-python

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.