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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
|
From 8afbefc445059be55dfd20785ee81e4533ae3af1 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Rogut=C4=97s=20Sparnuotos?= <rogutes@googlemail.com>
Date: Sun, 26 Feb 2012 11:05:48 +0200
Subject: [PATCH] Imports are absolute by default in Python3.
---
psshlib/cli.py | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/psshlib/cli.py b/psshlib/cli.py
index c14b309..c342cde 100644
--- a/psshlib/cli.py
+++ b/psshlib/cli.py
@@ -6,7 +6,8 @@ import os
import shlex
import sys
import textwrap
-import version
+
+from psshlib import version
_DEFAULT_PARALLELISM = 32
_DEFAULT_TIMEOUT = 0 # "infinity" by default
--
1.7.9.1
--- a/psshlib/manager.py.orig 2012-02-02 17:13:09.000000000 +0100
+++ b/psshlib/manager.py 2016-01-17 11:52:13.764088460 +0100
@@ -4,0 +5 @@
+import fcntl
@@ -211,0 +213 @@
+ fcntl.fcntl(wakeup_writefd, fcntl.F_SETFL, os.O_NONBLOCK)
--- a/psshlib/askpass_server.py.orig 2012-02-02 17:13:09.000000000 +0100
+++ b/psshlib/askpass_server.py 2016-01-17 11:43:37.006779012 +0100
@@ -72 +72 @@
- bytes_written = conn.send(buffer)
+ bytes_written = conn.send(buffer.encode())
diff --git a/bin/pssh b/bin/pssh
index 860bad2..5fe726d 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)
|