Make python code compatible with urllib3 v2.6.0+ (#22520)

openapi-generator still uses methods that have been removed from urllib3
v2.6.0. The solution is as described in urllib3's 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).
> (#3622)

See https://urllib3.readthedocs.io/en/latest/changelog.html

Close #22514
This commit is contained in:
Jeremy Audet
2025-12-09 02:29:32 -05:00
committed by GitHub
parent 5a6fcd3bd5
commit cfcacf3074
28 changed files with 154 additions and 226 deletions

View File

@@ -129,7 +129,7 @@ class ApiException(OpenApiException):
self.body = http_resp.data.decode('utf-8')
except Exception:
pass
self.headers = http_resp.getheaders()
self.headers = http_resp.headers
@classmethod
def from_response(