diff --git a/sshfs/pools/base.py b/sshfs/pools/base.py index 478d2a1..a36fd08 100644 --- a/sshfs/pools/base.py +++ b/sshfs/pools/base.py @@ -38,7 +38,18 @@ def __init__( self.unsafe_terminate = unsafe_terminate self._stack = AsyncExitStack() - self.other_init_params = kwargs or {} + self.sftp_client_kwargs = { + k: v + for k, v in kwargs.items() + if k + in { + "env", + "send_env", + "path_encoding", + "path_errors", + "sftp_version", + } + } async def _maybe_new_channel(self): # If there is no hard limit or the limit is not hit yet @@ -49,7 +60,7 @@ async def _maybe_new_channel(self): ): try: return await self._stack.enter_async_context( - self.client.start_sftp_client(**self.other_init_params) + self.client.start_sftp_client(**self.sftp_client_kwargs) ) except ChannelOpenError: # If we can't create any more channels, then change