Skip to content

Commit 3c0d9ba

Browse files
committed
need to set the _cache default for cwd field in the Connection init instead of _sftp_channel
1 parent d048bd4 commit 3c0d9ba

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

sftpretty/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,7 @@ def __init__(self, host, cnopts=None, default_path=None, password=None,
191191
port=22, private_key=None, private_key_pass=None,
192192
timeout=None, username=None):
193193
self._cache = cache()
194+
self._cache.__dict__.setdefault('cwd', default_path)
194195
self._channels = {}
195196
self._cnopts = cnopts or CnOpts()
196197
self._config = self._cnopts.get_config(host)
@@ -317,7 +318,6 @@ def _sftp_channel(self):
317318
meta = channel.get_channel()
318319
meta.set_name(channel_name)
319320
log.debug(f'Channel Name: [{channel_name}]')
320-
self._cache.__dict__.setdefault('cwd', self._default_path)
321321
self._channels[channel_name] = {
322322
'busy': True, 'channel': channel, 'meta': meta
323323
}

0 commit comments

Comments
 (0)