getheaders is deprecated in urllib3 >= 2.0.0
まだ誰も着手していません。
評価
調査の方向性
client/rest.py を開き、traceback で参照されている getheaders 関数を調べてから、その呼び出し元と既存の urllib3 レスポンス処理を確認します。非推奨の関数を削除し、urllib3 >= 2.0.0 を使用した場合に、影響を受けるリクエストまたは例外のパスでその関数が呼び出されなくなることを確認します。
索引モデルが issue の本文から書いたものです。
説明
Please remove the deprecated function getheaders from client/rest.py
What happened (please include outputs or screenshots):
Traceback (most recent call last):
File "/home/mau/repos/project-automation/k8s/k8s.py", line 828, in <module>
main()
File "/home/mau/repos/project-automation/k8s/k8s.py", line 803, in main
k8s_project.create_namespace()
File "/home/mau/repos/project-automation/k8s/k8s.py", line 110, in create_namespace
self.__k8s_cluster.create_namespace(
File "/home/mau/.virtualenvs/project-automation-2/lib/python3.12/site-packages/pja_sdk/k8s.py", line 98, in create_namespace
namespace = self.__corev1api.create_namespace(body=body)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/mau/.virtualenvs/project-automation-2/lib/python3.12/site-packages/kubernetes/client/api/core_v1_api.py", line 6363, in create_namespace
return self.create_namespace_with_http_info(body, **kwargs) # noqa: E501
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/mau/.virtualenvs/project-automation-2/lib/python3.12/site-packages/kubernetes/client/api/core_v1_api.py", line 6454, in create_namespace_with_http_info
return self.api_client.call_api(
^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/mau/.virtualenvs/project-automation-2/lib/python3.12/site-packages/kubernetes/client/api_client.py", line 348, in call_api
return self.__call_api(resource_path, method,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/mau/.virtualenvs/project-automation-2/lib/python3.12/site-packages/kubernetes/client/api_client.py", line 180, in __call_api
response_data = self.request(
^^^^^^^^^^^^^
File "/home/mau/.virtualenvs/project-automation-2/lib/python3.12/site-packages/kubernetes/client/api_client.py", line 391, in request
return self.rest_client.POST(url,
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/mau/.virtualenvs/project-automation-2/lib/python3.12/site-packages/kubernetes/client/rest.py", line 279, in POST
return self.request("POST", url,
^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/mau/.virtualenvs/project-automation-2/lib/python3.12/site-packages/kubernetes/client/rest.py", line 238, in request
raise ApiException(http_resp=r)
^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/mau/.virtualenvs/project-automation-2/lib/python3.12/site-packages/kubernetes/client/exceptions.py", line 91, in __init__
self.headers = http_resp.getheaders()
^^^^^^^^^^^^^^^^^^^^^^
File "/home/mau/.virtualenvs/project-automation-2/lib/python3.12/site-packages/kubernetes/client/rest.py", line 44, in getheaders
return self.urllib3_response.getheaders()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'HTTPResponse' object has no attribute 'getheaders'. Did you mean: 'headers'?
How to reproduce it (as minimally and precisely as possible):
Install requirements (urllib3 >= 2.0.0) and call any function.
Environment:
- Kubernetes version (
kubectl version): v1.29.5 - OS (e.g., MacOS 10.13.6): Linux
- Python version (
python --version) 3.12.3 - Python client version (
pip list | grep kubernetes) 29.0.0
- 主要言語
- Python
- スター
- 7.7k
- フォーク
- 3.5k
- 平均マージ
- 1日 14時間
- マージ済み PR(30日)
- 18
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
kubernetes-client/python のほかの issue
-
Release 1.37 オープン
kubernetes-client/python#2691 · コメント 1 件 · リアクション 1 件 · 担当者 1 名 ·
-
Growing library size オープンhelp wanted
難易度 5/5 1週間以上 初心者へのやさしさ 35/100
kubernetes-client/python#2677 · コメント 13 件 · リアクション 1 件 ·
-
help wanted kind/feature
kubernetes-client/python#2602 · コメント 6 件 · 担当者 1 名 ·
-
kind/bug
kubernetes-client/python#2596 · コメント 12 件 · リアクション 2 件 · 担当者 1 名 ·
-
kind/feature
kubernetes-client/python#2533 · コメント 5 件 · 担当者 1 名 ·
kubernetes-client/python の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
-
enhancement
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100