~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/transport/ssh.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2011-06-30 18:28:17 UTC
  • mfrom: (5967.10.2 test-cat)
  • Revision ID: pqm@pqm.ubuntu.com-20110630182817-83a5q9r9rxfkdn8r
(mbp) don't use subprocesses for testing cat (Martin Pool)

Show diffs side-by-side

added added

removed removed

Lines of Context:
17
17
 
18
18
"""Foundation SSH support for SFTP and smart server."""
19
19
 
20
 
from __future__ import absolute_import
21
 
 
22
20
import errno
23
21
import getpass
24
22
import logging
354
352
class SubprocessVendor(SSHVendor):
355
353
    """Abstract base class for vendors that use pipes to a subprocess."""
356
354
 
357
 
    # In general stderr should be inherited from the parent process so prompts
358
 
    # are visible on the terminal. This can be overriden to another file for
359
 
    # tests, but beware of using PIPE which may hang due to not being read.
360
 
    _stderr_target = None
361
 
 
362
355
    def _connect(self, argv):
363
356
        # Attempt to make a socketpair to use as stdin/stdout for the SSH
364
357
        # subprocess.  We prefer sockets to pipes because they support
375
368
        else:
376
369
            stdin = stdout = subproc_sock
377
370
        proc = subprocess.Popen(argv, stdin=stdin, stdout=stdout,
378
 
                                stderr=self._stderr_target,
379
371
                                **os_specific_subprocess_params())
380
372
        if subproc_sock is not None:
381
373
            subproc_sock.close()