Browse Source

Set bufsize=0 when communicating to SSH client. Fixes hangs on Python3. Fixes #434.

Jelmer Vernooij 8 years ago
parent
commit
c06fb97e43
2 changed files with 4 additions and 1 deletions
  1. 3 0
      NEWS
  2. 1 1
      dulwich/client.py

+ 3 - 0
NEWS

@@ -28,6 +28,9 @@
  * Don't strip trailing newlines from extra headers.
    (Nicolas Dandrimont)
 
+ * Set bufsize=0 for subprocess interaction with SSH client.
+   Fixes hangs on Python 3. (René Stern, #434)
+
 0.16.3	2016-01-14
 
  TEST FIXES

+ 1 - 1
dulwich/client.py

@@ -949,7 +949,7 @@ class SubprocessSSHVendor(SSHVendor):
         if username is not None:
             host = '%s@%s' % (username, host)
         args.append(host)
-        proc = subprocess.Popen(args + [command],
+        proc = subprocess.Popen(args + [command], bufsize=0,
                                 stdin=subprocess.PIPE,
                                 stdout=subprocess.PIPE)
         return SubprocessWrapper(proc)