WSClient.update() fails on select.poll() when running in eventlet on Linux #1753
Labels
kind/bug
Categorizes issue or PR as related to a bug.
lifecycle/stale
Denotes an issue or PR has remained open with no activity and has become stale.
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:
kubectl version
): 1.19, 1.21python --version
) 3.8pip list | grep kubernetes
) 23.3.0The text was updated successfully, but these errors were encountered: