From 8677ef5eb49cf310c9ab2e12b69432a7fde304ec Mon Sep 17 00:00:00 2001 From: peter_yu Date: Fri, 6 May 2022 10:20:08 +0000 Subject: [PATCH] [ZTP] bufsize=1 not supported in binary mode In Python 3.8, line buffering (buffering=1) isn't supported in binary mode --- src/usr/lib/python3/dist-packages/ztp/ZTPLib.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/usr/lib/python3/dist-packages/ztp/ZTPLib.py b/src/usr/lib/python3/dist-packages/ztp/ZTPLib.py index 5882ee2..f2354ce 100644 --- a/src/usr/lib/python3/dist-packages/ztp/ZTPLib.py +++ b/src/usr/lib/python3/dist-packages/ztp/ZTPLib.py @@ -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()