1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
|
From: =?utf-8?b?5L6d5LqR?= <lilydjwg@gmail.com>
Date: Fri, 11 Mar 2016 17:39:37 +0800
Subject: pssh: read stdin as bytes in Python 3
Forwarded: https://github.com/lilydjwg/pssh/commit/92729ad8954b87766f1096c8c73bd2120efc461c
---
bin/pssh | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/bin/pssh b/bin/pssh
index 5b6c2a5..4648c10 100755
--- a/bin/pssh
+++ b/bin/pssh
@@ -65,7 +65,10 @@ def do_pssh(hosts, cmdline, opts):
if opts.errdir and not os.path.exists(opts.errdir):
os.makedirs(opts.errdir)
if opts.send_input:
- stdin = sys.stdin.read()
+ if hasattr(sys.stdin, 'buffer'):
+ stdin = sys.stdin.buffer.read()
+ else:
+ stdin = sys.stdin.read()
else:
stdin = None
manager = Manager(opts)
|