From 667112d919a06792473a17d5d73cd569ee6ddc92 Mon Sep 17 00:00:00 2001 From: idziubenko Date: Thu, 12 Aug 2021 12:15:34 +0300 Subject: [PATCH] fixed pipe encoding --- pym/install/distr.py | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/pym/install/distr.py b/pym/install/distr.py index d09a5ee..15a901c 100644 --- a/pym/install/distr.py +++ b/pym/install/distr.py @@ -1250,20 +1250,22 @@ class PartitionDistributive(Distributive): pipe = Popen([fdiskProg, deviceName], stdin=PIPE, stdout=PIPE, stderr=PIPE) if devicePartitionCount > 1: - pipe.stdin.write("t\n%s\n%s\nw\n" % (partitionNumber, - systemid)) + tmp = "t\n%s\n%s\nw\n" % (partitionNumber, systemid) + pipe.stdin.write(tmp.encode("UTF-8")) else: - pipe.stdin.write("t\n%s\nw\n" % systemid) + tmp = "t\n%s\nw\n" % systemid + pipe.stdin.write(tmp.encode("UTF-8")) pipe.stdin.close() pipe.wait() elif parttable == "gpt": pipe = Popen([gdiskProg, deviceName], stdin=PIPE, stdout=PIPE, stderr=PIPE) if devicePartitionCount > 1: - pipe.stdin.write("t\n%s\n%s\nw\ny\n" % (partitionNumber, - systemid)) + tmp = "t\n%s\n%s\nw\ny\n" % (partitionNumber, systemid) + pipe.stdin.write(tmp.encode("UTF-8")) else: - pipe.stdin.write("t\n%s\nw\ny\n" % systemid) + tmp = "t\n%s\nw\ny\n" % systemid + pipe.stdin.write(tmp.encode("UTF-8")) pipe.stdin.close() pipe.wait() for waittime in (0.1, 0.2, 0.5, 1, 2, 4):