Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

'ClientResponse' object has no attribute 'get header' #122

Closed
mnasiri opened this issue Oct 22, 2020 · 2 comments
Closed

'ClientResponse' object has no attribute 'get header' #122

mnasiri opened this issue Oct 22, 2020 · 2 comments
Assignees
Labels
bug Something isn't working

Comments

@mnasiri
Copy link

mnasiri commented Oct 22, 2020

This issue is seen when run my project with ver.12.0.0 of kubernetes_asyncio which it was worked with ver. 11.3.0.

resp = await v1.read_namespaced_pod_log(podname, namespace, container=container, **params)
  File "..\.venv\lib\site-packages\kubernetes_asyncio\client\api_client.py", line 191, in __call_api
    content_type = response_data.getheader('content-type')
AttributeError: 'ClientResponse' object has no attribute 'getheader'

content_type = response_data.getheader('content-type')

to fix it, I change it to
content_type = response_data.headers.get('content-type')

I use :
aiohttp==3.6.3
urllib3==1.25.11
Thanks for your attempts.

@tomplus
Copy link
Owner

tomplus commented Oct 22, 2020

@mnasiri Thanks for reporting this issue.

It appears when you call any methods with preload_content=False (eg. Watch() works in this way). I'll fix it ASAP.

@tomplus
Copy link
Owner

tomplus commented Oct 22, 2020

It has been fixed in v12.0.1

@tomplus tomplus closed this as completed Oct 22, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants