summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--paramiko/client.py10
1 files changed, 6 insertions, 4 deletions
diff --git a/paramiko/client.py b/paramiko/client.py
index c809e4bb..127ab131 100644
--- a/paramiko/client.py
+++ b/paramiko/client.py
@@ -299,7 +299,7 @@ class SSHClient (object):
self._transport.close()
self._transport = None
- def exec_command(self, command):
+ def exec_command(self, command, bufsize=-1):
"""
Execute a command on the SSH server. A new L{Channel} is opened and
the requested command is executed. The command's input and output
@@ -308,6 +308,8 @@ class SSHClient (object):
@param command: the command to execute
@type command: str
+ @param bufsize: interpreted the same way as by the built-in C{file()} function in python
+ @type bufsize: int
@return: the stdin, stdout, and stderr of the executing command
@rtype: tuple(L{ChannelFile}, L{ChannelFile}, L{ChannelFile})
@@ -315,9 +317,9 @@ class SSHClient (object):
"""
chan = self._transport.open_session()
chan.exec_command(command)
- stdin = chan.makefile('wb')
- stdout = chan.makefile('rb')
- stderr = chan.makefile_stderr('rb')
+ stdin = chan.makefile('wb', bufsize)
+ stdout = chan.makefile('rb', bufsize)
+ stderr = chan.makefile_stderr('rb', bufsize)
return stdin, stdout, stderr
def invoke_shell(self, term='vt100', width=80, height=24):