Description
What happened (please include outputs or screenshots):
WSClient.update() was modified by PR kubernetes-client/python-base#268 to use select.poll() instead of select.select, which breaks when running under eventlet on Linux:
File "/usr/local/lib/python3.8/site-packages/kubernetes/stream/ws_client.py", line 182, in update
poll = select.poll()
AttributeError: module 'select' has no attribute 'poll'
module 'select' has no attribute 'poll'
eventlet monkey_patches the select module and does not support the poll() method
Adding a check on getattr(select, "poll", None) is None to the if statement and reverting to select.select when there is no poll attribute will fix the problem.
I'll push a PR
What you expected to happen:
No exception should occur
How to reproduce it (as minimally and precisely as possible):
Anything else we need to know?:
Environment:
- Kubernetes version (
kubectl version
): 1.19, 1.21 - OS (e.g., MacOS 10.13.6): CentOS 7
- Python version (
python --version
) 3.8 - Python client version (
pip list | grep kubernetes
) 23.3.0