kubernetes-client / python-base

Apache License 2.0
70 stars 185 forks source link

WSClient.update() fails on select.poll() when running in eventlet on Linux #281

Closed bobh66 closed 2 years ago

bobh66 commented 2 years ago

WSClient.update() was modified by PR #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

bobh66 commented 2 years ago

/assign

roycaihw commented 2 years ago

This repo has been merged into the main python repo. We are archiving this repo. Please open a new issue in the main repo. Thanks!

/close

k8s-ci-robot commented 2 years ago

@roycaihw: Closing this issue.

In response to [this](https://github.com/kubernetes-client/python-base/issues/281#issuecomment-1066133232): >This repo has been merged into the main [python repo](https://github.com/kubernetes-client/python). We are archiving this repo. Please open a new issue in the main repo. Thanks! > >/close Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md). If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes/test-infra](https://github.com/kubernetes/test-infra/issues/new?title=Prow%20issue:) repository.