critical change
authorThierry Parmentelat <thierry.parmentelat@inria.fr>
Tue, 15 Mar 2016 14:47:54 +0000 (15:47 +0100)
committerThierry Parmentelat <thierry.parmentelat@inria.fr>
Tue, 15 Mar 2016 14:47:54 +0000 (15:47 +0100)
one of the hacks I had done for python3 turns out to
severely break dealing with binary files
revert that change for now; it's probably safer to use py2 only with
this version, and a deeper fix will be needed later on

nepi/util/sshfuncs.py

index fa7df4b..ca339b1 100644 (file)
@@ -849,7 +849,8 @@ def _communicate(proc, input, timeout=None, err_on_timeout=True):
         # data = os.read(proc.stdout.fileno(), 1024)
         # but this would return bytes, so..
         if proc.stdout in rlist:
-            data = proc.stdout.read()
+            #data = proc.stdout.read()
+            data = os.read(proc.stdout.fileno(), 1024)
             if not data:
                 proc.stdout.close()
                 read_set.remove(proc.stdout)
@@ -858,7 +859,8 @@ def _communicate(proc, input, timeout=None, err_on_timeout=True):
 
         # likewise
         if proc.stderr in rlist:
-            data = proc.stderr.read()
+            #data = proc.stderr.read()
+            data = os.read(proc.stderr.fileno(), 1024)
             if not data:
                 proc.stderr.close()
                 read_set.remove(proc.stderr)