File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -226,6 +226,7 @@ def open(
226226 port = None ,
227227 connect_kwargs = None ,
228228 prefetch_kwargs = None ,
229+ buffer_size = - 1 ,
229230):
230231 """Open a file on a remote machine over SSH.
231232
@@ -238,7 +239,7 @@ def open(
238239 mode: str, optional
239240 The mode to use for opening the file.
240241 host: str, optional
241- The hostname of the remote machine. May not be None.
242+ The hostname of the remote machine. May not be None.
242243 user: str, optional
243244 The username to use to login to the remote machine.
244245 If None, defaults to the name of the current user.
@@ -251,6 +252,8 @@ def open(
251252 prefetch_kwargs: dict, optional
252253 Any additional settings to be passed to paramiko.SFTPFile.prefetch.
253254 The presence of this dict (even if empty) triggers prefetching.
255+ buffer_size: int, optional
256+ Passed as bufsize argument to paramiko.SFTPClient.open.
254257
255258 Returns
256259 -------
@@ -297,7 +300,7 @@ def open(
297300 #
298301 del _SSH [key ]
299302
300- fobj = sftp_client .open (path , mode )
303+ fobj = sftp_client .open (path , mode = mode , bufsize = buffer_size )
301304 fobj .name = path
302305 if prefetch_kwargs is not None :
303306 fobj .prefetch (** prefetch_kwargs )
You can’t perform that action at this time.
0 commit comments