Skip to content

Fix urllib3 getheaders/getheader deprecation in RESTResponse (#195)#232

Open
CedricConday wants to merge 1 commit into
XeroAPI:masterfrom
CedricConday:fix/195-urllib3-getheaders-deprecation
Open

Fix urllib3 getheaders/getheader deprecation in RESTResponse (#195)#232
CedricConday wants to merge 1 commit into
XeroAPI:masterfrom
CedricConday:fix/195-urllib3-getheaders-deprecation

Conversation

@CedricConday

Copy link
Copy Markdown

Re-opens #225, which was closed in error (an automated cleanup pass on my account closed a batch of valid PRs and deleted their branches — this restores the work).

urllib3 deprecated HTTPResponse.getheaders() / getheader() in favour of accessing HTTPResponse.headers directly. RESTResponse wrapped those deprecated accessors, emitting DeprecationWarnings on every response. This switches to the non-deprecated API. Fixes #195.

…#195)

urllib3 deprecated HTTPResponse.getheaders() and getheader() in favour of
accessing HTTPResponse.headers directly. RESTResponse wrapped those
deprecated accessors, emitting DeprecationWarnings on every response and
risking breakage when urllib3 removes them.

Read headers via .headers / .headers.get() instead. The public
RESTResponse.getheaders()/getheader() methods are unchanged, so callers
in api_client and exceptions keep working. Adds regression tests pinning
the wrapper to the non-deprecated accessors.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

DeprecationWarning in api_client and rest: getheader and getheaders

1 participant