Skip to content

Commit

Permalink
[ZTP] bufsize=1 not supported in binary mode
Browse files Browse the repository at this point in the history
In Python 3.8, line buffering (buffering=1) isn't supported in binary mode
  • Loading branch information
peter-yu committed Jun 27, 2023
1 parent 8768991 commit 8677ef5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/usr/lib/python3/dist-packages/ztp/ZTPLib.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ def runCommand(cmd, capture_stdout=True, use_shell=False):
else:
shcmd = cmd
if capture_stdout is True:
proc = subprocess.Popen(shcmd, shell=use_shell, stdout=subprocess.PIPE, stderr=subprocess.PIPE, bufsize=1, close_fds=True)
proc = subprocess.Popen(shcmd, shell=use_shell, stdout=subprocess.PIPE, stderr=subprocess.PIPE, close_fds=True)
pid = proc.pid
runcmd_pids.append(pid)
output_stdout, output_stderr = proc.communicate()
Expand Down

0 comments on commit 8677ef5

Please sign in to comment.