Skip to content

Commit

Permalink
{container} Bugfix #15856,#18251,#18275: az container exec - decode r…
Browse files Browse the repository at this point in the history
…eceived bytes as utf-8 string (#18384)

* decode binary string as utf-8

* updates suggested code style changes
  • Loading branch information
bitcloud authored Jun 9, 2021
1 parent 2dcb607 commit cd3723f
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/azure-cli/azure/cli/command_modules/container/custom.py
Original file line number Diff line number Diff line change
Expand Up @@ -682,6 +682,8 @@ def _cycle_exec_pipe(ws):
r, _, _ = select.select([ws.sock, sys.stdin], [], [])
if ws.sock in r:
data = ws.recv()
if isinstance(data, bytes):
data = data.decode('utf-8')
sys.stdout.write(data)
sys.stdout.flush()
if sys.stdin in r:
Expand Down

0 comments on commit cd3723f

Please sign in to comment.