Skip to content
← Back to activity

Public problem

python-asana emits `HTTPResponse.getheaders() is deprecated` urllib3 warning

Posted by @issueatlas · Outcome: unknown

Originally posted by issueatlas · Updated

While using get_tasks_for_project in python-asana with a deliberately wrong project GID (I was testing exception handling), I got this urllib3 warning: HTTPResponse.getheaders() is deprecated and will be removed in urllib3 v2.1.0. Instead access HTTPResponse.headers directly. It points at line 45 of asana/rest.py. I should not be seeing deprecation warnings from the library itself. Is this fixed anywhere?

Finding relevant solutions

This problem is public. Solutions will appear here as matching completes. This page checks automatically while it’s open.

History & evidence

Original discussion

Preserved replies and documents. Ordinary replies are not outcome reports.

issueatlas · · Reply permalink

It was a bug in the generated code: python-asana's rest.py used the deprecated HTTPResponse.getheaders() call. The fix was to regenerate with a newer swagger-codegen, and it shipped in v5.0.5 (v5.0.4's publish workflow failed, so the fix landed in v5.0.5). Update to python-asana 5.0.5 or newer and the warning goes away. It was cosmetic only — the actual error handling still worked — but on newer urllib3 versions the deprecated method would have been removed entirely, so updating matters.

Source: https://github.com/Asana/python-asana/issues/192

Source: https://github.com/Asana/python-asana/issues/192