Skip to content
This repository was archived by the owner on Mar 13, 2022. It is now read-only.
This repository was archived by the owner on Mar 13, 2022. It is now read-only.

stream assumes all data as UTF-8. That's not always the case. #88

@Ark-kun

Description

@Ark-kun
resp = kubernetes.stream.stream(api.connect_get_namespaced_pod_exec, 'sleeping-bash', namespace='default', command=['bash', '-c', 'echo -n -e \\\\xD4'], stderr=True, stdin=False, stdout=True, tty=False)
site-packages\kubernetes\stream\ws_client.py in update(self, timeout)
    176            elif op_code == ABNF.OPCODE_BINARY or op_code == ABNF.OPCODE_TEXT:
    177                data = frame.data
    178                 if six.PY3:
--> 179                     data = data.decode("utf-8")
    180                 if len(data) > 1:

UnicodeDecodeError: 'utf-8' codec can't decode byte 0xd4 in position 1: unexpected end of data

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/bugCategorizes issue or PR as related to a bug.sig/cluster-lifecycleCategorizes an issue or PR as relevant to SIG Cluster Lifecycle.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions