File tree 1 file changed +13
-2
lines changed
1 file changed +13
-2
lines changed Original file line number Diff line number Diff line change @@ -38,7 +38,18 @@ def __init__(
38
38
self .unsafe_terminate = unsafe_terminate
39
39
self ._stack = AsyncExitStack ()
40
40
41
- self .other_init_params = kwargs or {}
41
+ self .sftp_client_kwargs = {
42
+ k : v
43
+ for k , v in kwargs .items ()
44
+ if k
45
+ in {
46
+ "env" ,
47
+ "send_env" ,
48
+ "path_encoding" ,
49
+ "path_errors" ,
50
+ "sftp_version" ,
51
+ }
52
+ }
42
53
43
54
async def _maybe_new_channel (self ):
44
55
# If there is no hard limit or the limit is not hit yet
@@ -49,7 +60,7 @@ async def _maybe_new_channel(self):
49
60
):
50
61
try :
51
62
return await self ._stack .enter_async_context (
52
- self .client .start_sftp_client (** self .other_init_params )
63
+ self .client .start_sftp_client (** self .sftp_client_kwargs )
53
64
)
54
65
except ChannelOpenError :
55
66
# If we can't create any more channels, then change
You can’t perform that action at this time.
0 commit comments