-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
WSClient.update should not decode binary data frames #2005
Comments
I will take a look at the issue and will make necessary changes. |
Thanks for reporting the issue @vereszol. And thanks for contributing @venukarnati92 |
@vereszol I believe we have to decode the binary data too based on the way it's implemented. For example an empty string frame will be like this
|
@venukarnati92 The code block in question would be skipped even without decoding data because On the other hand, I found that the change I suggested breaks Unfortunately the end result would anyway be backwards incompatible as it might change the data type of stdout or stderr channel. For this reason I will close the ticket. |
What happened (please include outputs or screenshots):
https://github.com/kubernetes-client/python/blob/v25.3.0/kubernetes/base/stream/ws_client.py#L198-L203
WSClient.update
is decoding the received WebSocket data frame even if the opcode indicates a binary payload.According https://www.rfc-editor.org/rfc/rfc6455#section-5.6 text data frames are encoded as UTF-8, binary is not.
What you expected to happen:
Only text data frames should be decoded. A possible solution would be:
How to reproduce it (as minimally and precisely as possible):
Call
WSClient.update
Anything else we need to know?:
This change would enable copying of binary files to/from pods, similar to #1471
Environment:
kubectl version
):python --version
):3.7.3
or newerpip list | grep kubernetes
):25.3.0
The text was updated successfully, but these errors were encountered: