~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/transport/sftp.py

From Matt Lavin: close_fds is not supported on Windows platforms

Show diffs side-by-side

added added

removed removed

Lines of Context:
54
54
if 'sftp' not in urlparse.uses_netloc: urlparse.uses_netloc.append('sftp')
55
55
 
56
56
 
 
57
_close_fds = True
 
58
if sys.platform == 'win32':
 
59
    # close_fds not supported on win32
 
60
    _close_fds = False
 
61
 
57
62
_ssh_vendor = None
58
63
def _get_ssh_vendor():
59
64
    """Find out what version of SSH is on the system."""
65
70
 
66
71
    try:
67
72
        p = subprocess.Popen(['ssh', '-V'],
68
 
                             close_fds=True,
 
73
                             close_fds=_close_fds,
69
74
                             stdin=subprocess.PIPE,
70
75
                             stdout=subprocess.PIPE,
71
76
                             stderr=subprocess.PIPE)
114
119
                args.extend(['-l', user])
115
120
            args.extend(['-s', 'sftp', hostname])
116
121
 
117
 
        self.proc = subprocess.Popen(args, close_fds=True,
 
122
        self.proc = subprocess.Popen(args, close_fds=_close_fds,
118
123
                                     stdin=subprocess.PIPE,
119
124
                                     stdout=subprocess.PIPE)
120
125