1
0
mirror of https://github.com/CumulusNetworks/ifupdown2.git synced 2024-05-06 15:54:50 +00:00

python3: ch.communicate input should be bytes not str

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
This commit is contained in:
Julien Fortin
2019-10-02 18:31:53 +02:00
parent c9496c0ae4
commit 6ab519dd59

View File

@ -412,7 +412,7 @@ class utils():
stderr=stderr)
utils.enable_subprocess_signal_forwarding(ch, signal.SIGINT)
if stdout or stdin:
cmd_output = ch.communicate(input=stdin)[0]
cmd_output = ch.communicate(input=stdin.encode() if stdin else stdin)[0]
cmd_returncode = ch.wait()
except Exception as e:
raise Exception('cmd \'%s\' failed (%s)' % (' '.join(cmd), str(e)))