You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is seen when calling DockerClient.container.run() or DockerClient.container.logs() if the container console contains output that is not UTF-8 encoded. This can be reproduced by outputting a character in another encoding as shown below.
Related to #370. Perhaps DockerClient.container.logs() should take an encoding parameter rather than assuming utf-8.
>>> import python_on_whales as pow
>>> podman = pow.DockerClient(client_call=["podman"])
>>> bash_cmd = r"echo -n $'\xfe'"
>>> full_cmd = ["bash", "-c", bash_cmd]
>>> ctr = podman.run("ubuntu", full_cmd)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File ".../python_on_whales/components/container/cli_wrapper.py", line 1764, in run
return run(full_cmd, tty=tty, capture_stderr=False, pass_fds=pass_fds)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File ".../python_on_whales/utils.py", line 215, in run
return post_process_stream(completed_process.stdout)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File ".../python_on_whales/utils.py", line 221, in post_process_stream
stream = stream.decode()
^^^^^^^^^^^^^^^
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xfe in position 0: invalid start byte
The text was updated successfully, but these errors were encountered:
This is seen when calling
DockerClient.container.run()
orDockerClient.container.logs()
if the container console contains output that is not UTF-8 encoded. This can be reproduced by outputting a character in another encoding as shown below.Related to #370. Perhaps
DockerClient.container.logs()
should take anencoding
parameter rather than assuming utf-8.The text was updated successfully, but these errors were encountered: